Disabling View And Layout

If you are using MVC components of Zend Framework, you will come across situations where you will have to disable view and layout. To do so you use the viewRenderer and layout action helpers and call the setNoRenderer() and disableLayout() methods respectively.

How to disable the view?

In your controller action

<?php
$this
->_helper->viewRenderer->setNoRender(true);
?>

How to disable the layout?

In your controller action

<?php
$this
->_helper->layout->disableLayout()
?>

Did the code snippet solve your problem?

Programming: 
Content Type: 
FOSS Project: 

Add new comment