I\'m going to start a project using a Zend Framework MVC implementation.
How do I work with ajax? I mean, should I place all ajax code into controller? Or into view?
Take a look at the AjaxContext Action-Helper (or the ContextSwitch one, which it extends), and it will allow you to use exactly the same controller code, switching to either a separate view-script (foo.json.phtml, or foo.ajax.phtml etc. - picked up automatically from a ?format parameter), or make use of the JSON Action-Helper that will return an object comprising all the variables you assign to the view - so you don't need to be echoing from your controller (which will mess up unit-tests, should you have them).