Prevent a view rendering with the Zend FrameworkPrevent a view rendering with the Zend Framework

Posted June 25th, 2009 in PHP

The front controller of the Zend Framework will render a view by default but it's possible to disable this automatic rendering should you need to, for example if making an Ajax call which sends some JSON data instead of an HTML template.

In the action simply add the following line of code and it will not render the view:

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

Related posts:

Comments

blog comments powered by Disqus