Bootstrapping the Application: the Standard Layout Resource Plugin
Friday, September 25, 2009

The Zend Framework offers a template module called Zend_Layout. This is primarily used to render the standard parts of a web page, such as the header, sidebars and footer, and to insert the variable content into placeholders. However, it can also be used to render other things with standard layouts, such as e-mails. We shall have a look at examples of both in later posts.

To use Zend_Layout, you need to specify the location of the layout scripts, then invoke Zend_Layout::startMvc(). The standard resource plugin Zend_Application_Resource_Layout is used by Zend_Application to automate this process. To use this plugin, you should add the following line to the configuration file:

resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"

This specifies the location of the layout scripts. If your scripts are in a different location, you should change the value of layoutPath.

We shall look at Zend_Layout in more detail in later posts.

Posted by James at 3:07 pm   0 comments

Leave a Reply