Setting Up a Specific Layout for a Zend Action

Now that’s really simple! In your action method simply add this line:

$this->view->layout()->setLayout('embed');

Thus the code will look like so:

<?php
 
class IndexController extends Zend_Controller_Action
{
	public function indexAction()
	{
		$this->view->layout()->setLayout('embed');
		// ...	
	}	
}

Related posts:

  1. Zend Framework – Disable Zend Layout
  2. Bind Zend Action with Non-Default View
  3. Zend Framework: Inject JavaScript Code in a Action/View
This entry was posted in micro tutorial, PHP, zend framework and tagged , , , . Bookmark the permalink.

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="">