Disable Zend View Renderer

Zend Framework Logo

In case you need to disable Zend View’s Renderer because you want to return custom data (JSON, XML, etc.) simply using the following lines to do so:

$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);

Then you can return your response in any format you want, just don’t forget to set the content type accordingly.

That’s it.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.