1
votes

I'm using Zend navigation to display menu items on the site.

in below bootstrap function, what does it mean by 'layout' in
$this->bootstrap('layout') ? Is it layout file name with path ?, since i have several modules, its bit confusing.

protected function _initNavigation()
{
    $this->bootstrap('layout');
    $layout = $this->getResource('layout');
    $view = $layout->getView();             
    $config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav');

     $container = new Zend_Navigation($config);

     $view->navigation($container);

} 
2

2 Answers

1
votes

The layout is the site template that will be present in all site pages.

(To make it simple : for example you have a header and footer that will be present in all website pages, you put them in a layout and they will automaticaly included in all the pages)

For more informations on Zend Layout see Zend Layout Documentation

Edit :

You can specify on layout for all modules, or you can make one layout per module (it is your choice and it depends on what you want to)

1
votes

$this->bootstrap('layout') ? Is it layout file name with path ?,

This means that Zend first will bootstrap Zend_Application_Resource_Layout

More you can find here: http://framework.zend.com/manual/en/zend.application.available-resources.html#zend.application.available-resources.layout