Zend Framework – Disable Zend Layout

submit to reddit

What’s Zend Layout

Everybody knows that sometimes you need header and footer for almost every page. In Zend Framework you don’t need to include them in every template page, as it will be if you were using Smarty for instance. You just need to use Zend_Layout. It’s easy and it’s helpful.

What if you don’t need layout for a controller action?

Well if you have to have a given controller action with no use of Zend_Layout, you just need to disable it.

How …

… simply by placing this line in you controller action:

$this->_helper->layout->disableLayout();

Related posts:

  1. Accessing the layout() in Zend Framework
  2. Zend Framework – quick tutorial (part 3) – front controller plugins
  3. Default Error Handling in Zend Framework

You are a GREAT developer? Click here to answer the weekly quiz!

This entry was posted in featured, micro tutorial, PHP, web development, zend framework and tagged , , , . Bookmark the permalink.

4 Responses to Zend Framework – Disable Zend Layout

  1. Prabhu Patil says:

    Super

  2. Neo says:

    simple,useful,great

  3. camilord says:

    this article helps a lot with my first zend framework project… thanks stoimen…

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">