I've been working on this library for 2 years now and using on many websites with great success. And I decided to make it public, I can assure this is the best jQuery <=> PHP bridge library there is for PHP 5.3 at the moment. I've created the documentation using phpDocumentor 2, but people are shy and never leave any constructive criticism or areas that could be made differently/better, so I think the best would be in CodeReview I guess. It can submit complex forms with infinite nesting, can have nested JSON responses, can access the calling DOM element, can access any object in the browser or set any var or call any function in any global object.
The docs are here http://phery-php-ajax.net/docs
The demo is here http://phery-php-ajax.net/demo.php
Some sample code:
function data($ajax_data, $callback_data, Phery $phery)
{
return
PheryResponse::factory($callback_data['submit_id']) // submit_id will have #special2
->merge('scrollTop')
->data('testing', array('nice' => 'awesome'))
->jquery('div.test2')
->css(array('backgroundColor' => '#f5a'))
->animate(array(
'width' => "70%",
'opacity' => 0.8,
'marginLeft' => "0.6in",
'fontSize' => "1em",
'borderWidth' => "10px"
), 1500, 'linear', PheryFunction::factory(
<<<JSON
function(){
$(this).append("<br>yes Ive finished animating and fired from inside PHP as an animate() completion callback using PheryFunction rawr!");
}
JSON
));
}
Phery::instance()->set(array('remote' => 'data'))->process();
this function would be called from Javascript
phery.remote('remote');
Access the main site for the github repo. Thanks!