Disable layout and view renderer in Zend Framework
Posted on 2010-04-18 15:51 Neil's NoteBook 閱讀(166) 評論(0) 編輯 收藏 Just a quick tip: I’m working on a project using Zend Framework and
needed to switch off layout and view renderer for a specific controller.
This can be achieved by adding the following calls to the controller’s
preDispatch()
method:
public function preDispatch()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer- >setNoRender(true);
}
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer- >setNoRender(true);
}