Best way to structure AJAX for a Zend Framework application

Posted by John Nall on Stack Overflow See other posts from Stack Overflow or by John Nall
Published on 2010-05-28T01:18:50Z Indexed on 2010/05/28 1:21 UTC
Read the original article Hit count: 275

Filed under:
|
|
|
|

Sorry, but there's a lot of outdated and just plain bad information for Zend Framework, since it has changed so much over the years and is so flexible.

I thought of having an AJAX module service layer, with controllers and actions that interact with my model. Easy, but not very extensible and would violate DRY. If I change the logistics of some process I'll have to edit the AJAX controllers and the normal controllers.

So ideally I would load the exact same actions for both javascript and non-javascript users. I have thought about maybe checking for $_POST['ajax'], if it is set I would load a different (json'y) view for the data. Was wondering how/a good way to do this (front controller plugin I imagine?) or if someone can point me to an UP TO DATE tutorial that describes a really good way for building a larger ajax application.

thx

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript