Disable layout and view render
These are two simple lines that help you to disable layout and view render for a specific action:
public function indexAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
}
If you want switch off them for all actions of controller put these lines into preDispatch() method:
public function preDispatch()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
}
Peter Ruijter April 11, 2011 12:49:01
Thanks for this addon…
Inside the default Zend Framework documentation, the line
$this->_helper->layout()->disableLayout();
is not used, so an XML error message will be generated in a Zend Framework setup with a layout.
gliteringd March 30, 2012 11:48:54
gud