: This article mainly introduces Layout of ZendFramework. For more information about PHP tutorials, see Layout. To display different views in the same layout, we can write a layout template file and use layout. phtml is saved in the Index. specifies the location of the file in php.
- Require_ Once 'zend/Layout. php ';
- Zend_Layout: startMvc (array ('layoutpath' => '../application/default/layouts '));
In the layout file, we can specify the style file and JavaScript script file to be used by the webpage.
- "Text/html; charset = utf-8"/>
-
- $ Request = Zend_Controller_Front: getInstance ()-> getRequest ();
- $ This-> headTitle ('use view' in the view ')
- -> HeadTitle ($ request-> getModuleName ())
- -> HeadTitle ($ request-> getActionName ())
- -> HeadTitle ($ request-> getControllerName ())
- -> SetSeparator ('| ');
- Echo $ this-> headTitle ();
- $ This-> headLink ()-> appendStylesheet ($ this-> baseUrl. "/css/style.css? 1.1.9 ")
- -> AppendStylesheet ($ this-> baseUrl. "/css/demo.css? 1.1.9 ");
- Echo $ this-> headLink ();
- $ This-> headScript ()-> appendFile ($ this-> baseUrl. "/js/jquery-1.2.6.js? 1.1.9 ")
- -> AppendFile ($ this-> baseUrl. "/js/jquery. datePicker. js? 1.1.9 ")
- -> AppendFile ($ this-> baseUrl. "/js/demo. js? 1.1.9 ");
- Echo $ this-> headScript ();
- ?>
-
-
- Partial ('header. phtml', 'default');?>
-
- Partial ('leftside. phtml', 'default');?>
-
- Layout ()-> content;?>
-
- Partial ('footer. phtml', 'default');?>
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.
The above introduces Layout of Zend Framework, including The require content, and hopes to help friends who are interested in PHP tutorials.