1. First modify the application configuration file
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"
Specify the location of the layout file
2 .Then the easiest way is to modify the bootstrap.php file to add an automatic execution method:
protected function _initDoctype() { }
3. Add a
resources.view[] =
Here we assign a value to the view, although it is just a null value~
4. Add
Copy code to our boot file. The code is as follows:
protected function _initDoctype( )
{
$this->bootstrap('view');//Open the view
$view = $this->getResource('view');//The attempt to get the document. Definition In the main configuration
$view->doctype('XHTML1_STRICT'); //Set the document type
}
5. Finally, let us add a Layout.HTML The file can be found under application/layouts/scripts/
The content is:
Copy the code The code is as follows:
doctype() ?>
Zend Framework Quickstart Application
< ;?php echo $this->headLink()->appendStylesheet('/css/global.css') ?>
layout()->content ?> ;
Then check the page content. If there is a horizontal bar, it means success, and the bar will appear on all pages!
http://www.bkjia.com/PHPjc/327947.html
www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327947.htmlTechArticle1. First modify the application configuration file resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts" to specify the layout file Position 2. Then the easiest way is to modify the boot file...