How to disable a view script in a controller - Zend Framework

view, zend-framework

Solution

you can disable the view renderer controller helper, with this code in your controller:

public function myAction()
{
    $this->_helper->viewRenderer->setNoRender(true);
    // from now on, ZF won't search for a matching view script file.
}

Problem

I am playing with zend framework's MVC. One thing I found out is that Zend Framework tries to include a view script whenever a controller is called. I can disable it in bootstrap with the following code. $frontController->setParam('noViewRenderer',true); However, I have to initialize Zend_View class in a controller method then render a script file myself. How can I stop including a view script in a controller method so I can disable it if only I want to?

Original source