Skip Navigation LinksHome > Categories > Code from a Category

Zend AJAX



User Name: serfcompany
Name: Serf
Contact Me: www.datawebcoder.com
Home Page: www.datawebcoder.com
php,mysql,javascript,html,css. Preferable working with Zend Framework. Good know javascript. I worked with various, javascript frameworks such as(jquery, YUI3, extjs, sencha touch). [More]
Viewed Times: 2134
Add Date: 06/26/2012
The article is devoted to a demonstration of one of the simplest and most effective implementations of Ajax requests in the Zend Framework.

In order for the appropriate controller and action can make ajax requests, we need to add the following code in init () function:



Index then acts as a determinant of action, which will accept the request.


Now take the java-script code that will send a request to us.


The code is sent to the index controller -> page action:



We add to our action method code that will catch the ajax request:



Now that the java-script sends a request, triggered hook Zend Ajax, which receives the value and sends a response to a view. Zend Framework in this way sends data in JSON format.


Post a Comment

Name: (Optional)
Email: (Optional, you can get an email if somebody replys your comments)*
Email me if somebody respons my comment below:
Details**:
Enter Text
as Below:
(case insensitive, if hard to read, click the "get a new one" button)
 
    
* Your email address will not be shared with any third parties for any reason.
** Maximum 1000 charactors.