Detailed explanation of Layout (modular layout) in zend Framework_PHP tutorial

WBOY
Release: 2016-07-21 15:02:09
Original
1078 people have browsed it

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...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!