Prev | Current Page 126 | Next

Rob Allen, Nick Lo, and Steven Brown

"Zend Framework in Action"

manning-sandbox.com/forum.jspa?forumID=329
var request = YAHOO.util.Connect.asyncRequest('GET', sUrl, callback);
}
We now have a working Ajax example that uses the Zend Framework??™s MVC structure. The only changes
made to the basic example application were to ensure that the code was correctly separated according to its
role. We can now do something more interesting and look at how to fully integrate Ajax into a typical Zend
Framework application, such as the Places example application..
4.5 Integrating into a Zend Framework Application
When considering the use of Ajax in a Zend Framework application, it??™s not just the client side JavaScript that
needs to be written. We also have to ensure that the View doesn??™t try to display a full HTML page in response
to an Ajax request and that our controller doesn??™t do work that our model should be doing. To look at these
issues in context, we will write a feedback system into the Places example application.
Consider this use-case:
We are hoping that Places becomes very popular and so we will get lots of reviews on each location. We
would like to make it easy for users to let us know whether they thought any given review was helpful for
them. We can then display the ???helpfulness??? of each listed review to users which will guide them whilst
reading the site.


Pages:
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
pustaki szklane House Extension Kąty Rybackie noclegi kasyno Kołobrzeg