1. First modify the application configuration file
Resources.layout.layoutPath = Application_path "/layouts/scripts"
Specify the location of the layout file
2. The easiest way to do this is to modify the boot file bootstrap.php file to add an automated method:
protected function _initdoctype () {}
3. Add one to our configuration text
Resources.view[] =
Here we assign a value to the view, although he is just a null value ~
4. Add in our Boot file
Copy Code code as follows:
protected function _initdoctype ()
{
$this->bootstrap (' view ');//Open view
$view = $this->getresource (' view ');//attempt to get the document. defined in the master configuration
$view->doctype (' xhtml1_strict '); Set Document Type
}
5. Finally, let's add a layout.html file to the application/layouts/scripts/
Content is:
Copy Code code as follows:
<?php echo $this->doctype ()?>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title>zend Framework Quickstart application</title>
<?php echo $this->headlink ()->appendstylesheet ('/css/global.css ')?>
<body>
<div id= "header" style= "Background-color: #EEEEEE; height:30px; " >
<div id= "Header-logo" style= "Float:left" mce_style= "Float:left" >
<B>ZF Quickstart application</b>
</div>
<div id= "header-navigation" style= "Float:left" mce_style= "Float:left" >
<a href= "<?php Echo $this->url (
Array (' controller ' => ' guestbook '),
' Default ',
true)?> ">Guestbook</a>
</div>
</div>
<?php echo $this->layout ()->content?>
</body>
Then look at the content of the page, if there is a bar, then the success, the bar will appear in all pages!