I've spent much of the afternoon trying to get my ZF controller to play nice
with XHR requests, and not to output a bunch of other stuff after my JSON
output. I'm using Zend_Layout with the ActionStack, and this turned out to
be the problem. For the benefit of anyone else who has this issue, not only
do you need to disable view rendering and disable the layout in your
controller action:
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
You also need to prevent the ActionStack completing any more actions. The
only way I could find of doing this was to unregister it with the front
controller:
$this->getFrontController()->unregisterPlugin('Zend_Controller_Plugin_ActionStack');
Hopefully this will help someone in the future ...
--
View this message in context:
http://www.nabble.com/xhr%2C-layouts---ActionStack-tp22804929p22804929.html
Sent from the Zend Framework mailing list archive at Nabble.com.