Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrating AJAX and PHP

I've been writing PHP web applications for some time, and have come across very nice Javascript frameworks, such as JQuery, ExtJS, Scriptaculous, etc. I can't say the same about the PHP side - I always coded that part of the client-server dialog from scratch.

I've used CodeIgniter (http://codeigniter.com/) and it is nice, but doesn't deal with AJAX as a whole - rather providing input checking, image manipulation, and some output helpers.

Is there a standard PHP library/class/framework out there that deals/integrates with Javascript frameworks? Something that can catch users' responses/requests, validate identity and input, provide progress status, keep track of sessions, be aware of asynchronous events, etc.

like image 546
DV. Avatar asked Oct 04 '08 22:10

DV.


4 Answers

The Zend Framework is integrated with Dojo Toolkit. I haven't used the latest Zend Framework yet, but I do know that in the past, it has proven to be reliable.

like image 59
Thomas Owens Avatar answered Sep 20 '22 04:09

Thomas Owens


There might be one but I can't imagine why. An AJAX request looks and acts just like an HTTP request from the perspective of the server. You can get and set cookies. All the environment variables that you would expect from an HTTP request are there. All of the HTTP verbs work as do any of the header fields.

like image 22
Glenn Avatar answered Sep 20 '22 04:09

Glenn


In the next major release 1.5 CakePHP will come with jQuery.

like image 24
powtac Avatar answered Sep 19 '22 04:09

powtac


Sajax is one of a number of libraries that provide an easy way to link callbacks from client-side (JS) to server-side (PHP). Another library which does something similar is JPSpan however I am not sure if it is still actively supported. I have only done minor experiments with these two libraries so your mileage may vary.

like image 27
wioota Avatar answered Sep 23 '22 04:09

wioota