This article provides a detailed analysis of Layout (modular Layout) in zendFramework. For more information, see
This article provides a detailed analysis of Layout (modular Layout) in zend Framework. For more information, see
1. First modify the application configuration file
Resources. layout. layoutPath = APPLICATION_PATH "/layouts/scripts"
Location of the layout File
2. The simplest method is to modify the bootstrap. php file to add an automatic execution method:
Protected function _ initDoctype (){}
3. Add
Resources. view [] =
Here we assign a value to the view, which is an American space, although it is only a null value ~
4. Add the following content to our boot file:
The Code is as follows:
Protected function _ initDoctype ()
{
$ This-> bootstrap ('view'); // enable the view
$ View = $ this-> getResource ('view'); // The attempt to obtain the document is defined in the main configuration.
$ View-> doctype ('xhtml1 _ STRICT '); // you can specify the document type.
}
5. Add a Layout. HTML file under application/layouts/scripts /.
Content:
The Code is as follows:
Doctype ()?>
Zend Framework Quickstart Application
HeadLink ()-> appendStylesheet ('/css/global.css')?>
ZF Quickstart Application
Url (
Array ('controller' => 'guestbook '),
'Default ',
True)?> "> Guestbook
Layout ()-> content?>
Then, view the page content. If there is a horizontal bar on the Hong Kong server, it indicates that the page is successful and will appear on all pages!
, Hong Kong Space