how to disable both layout and renderer on entire Zend Framework application
I know how to disable them开发者_开发知识库 on specific controller:
$this->_helper->viewRenderer->setNoRender();
$this->_helper->layout->disableLayout();
And I know how to disable renderer in the bootstrap:
Zend_Controller_Front::getInstance()->setParam('noViewRenderer', true);
Is there any chance to disable layout in the bootstrap?
Try:
$l = Zend_Layout::getMvcInstance();
$l->disableLayout();
That will disable your layout. setNoRender
will disable all output, which one do you want? (In your post you state layout)
IFAIK the layout is disabled by default, until you enable layout resource in application.ini
, so disable it there.
精彩评论