jump to navigation

Zend Framework : Disable view and layout rendering April 15, 2011

Posted by Tournas Dimitrios in Zend Framework v1.10.

The front controller of the Zend Framework will render a view by default but it’s possible to disable this automatic rendering should you need to, for example if making an Ajax call which sends some JSON data instead of an HTML template .

Also the Zend Framework can be configured to display a layout on all pages (headers , footers , side-bars )  . If this rendering feature is enabled  , it can be disabled on some pages , should you need to .

In the controller action simply add the following line/s of code and it will not render the view/layout:

  class NameOfYourController extends Zend_Controller_Action
     public function init()
 // Local to this controller only; affects all actions,
 // as loaded in init:

    // Globally:

    // Also globally, but would need to be in conjunction with the

    // local version in order to propagate for this controller:

        ->setParam('noViewRenderer', true);


// disable autorendering for this action only:
   public function somenameAction()
*Disabling the layout

Read full article >>>>


No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s