Is there some kind a engine for Json in the Zend framework, What I mean is some abstraction that all the Json (ajax) responces go through ? in other words some class to controll all the Ajax calls?
+1, Zend_Json_Server is what you want. I wrote a blog post about it yesterday, coincidentally: http://ciaranmcnulty.com/blog/2010/03/clarifying-javascript-php-communication-using-json-rpc
Ciaran McNulty
2010-03-16 10:56:59
@Ciaran Nice. I was trying to find a decent article on Json_Server, so I added yours to the answer.
Gordon
2010-03-16 11:14:00
Thanks seniors -- as always valuable responses
simple
2010-03-16 11:58:06
btw I am really confused (and my Flexibility part is bugging me)ok lets say I have a form User Registration. I use it from JS. with a load(just get the html code) and it uses XMLhttp request right, then I need this for for Ajax again Xmlhttp request, but here I have to echo out JsonEncoded info and turn off View renderer, (problems starting) and after while I will need it with just regular request. so the dilemma is to handle it in a flexible way or have bunch of actions for different requests, but this way it is same hard coded . anyhow I am just confused - will appreciate ur advice
simple
2010-03-16 13:03:04
@simple please go through the two linked articles. If there is any questions then, open another question. The Comment Sections is akward for this.
Gordon
2010-03-16 13:29:12
A:
Your question is a little vague and could be interpreted in two ways.
a. You are just trying to serve ajax actions through your controllers.
This is pretty simple to achieve using the context switch action helper
b. You want to serve JSON responses via an API, whether it be to use internally or externally.
If that is the case, Zend_Rest_Controller is probably the direction you want to go in.
I hope this helps.
Travis
2010-03-16 16:59:26