How to disable layout inside a plugin?

2019-08-12 01:46发布

Here is what i'm trying to do

<?php
class My_Controller_Plugin_SomePlugin extends Zend_Controller_Plugin_Abstract
{

    public function preDispatch(Zend_Controller_Request_Abstract $request)
    {
             $this->_helper->layout()->disableLayout();
    }
}

but it doesn't work, any ideas on how could i disable the layout inside a plugin ?

1条回答
兄弟一词,经得起流年.
2楼-- · 2019-08-12 01:58

This should be enough if you are using Zend_Layout::startMvc()

Zend_Layout::getMvcInstance()->disableLayout();
查看更多
登录 后发表回答