In order to display different Views with the same layout, we can write a layout template file, save it as layout.phtml, and specify the location of this file in Index.php.
-
require_once'Zend/Layout.php';
-
Zend_Layout::startMvc(array('layoutP ath'=>'. ./application/default/layouts'));
In the layout file, we can specify the style files and JavaScript script files that the web page needs to use.
- "Content-Type"c/span>"text/html; charset= utf-8"/> -> headTitle(
- 'Use view in view')
-
->headTitle($request
- ->getModuleName())->headTitle($request ->getActionName())
-
->headTitle($request->getControllerName())
-
->setSeparator('|');
-
echo$this
->headTitle();-
$this->headLink()->appendStylesheet(
$this-
- ->baseUrl."/ css/style.css")
- ->appendStylesheet($this->baseUrl."/css/demo.css");echo
- $this->headLink();$this->headScript()->appendFile(
$this-
->baseUrl."/js/jquery- 1.2.6.js")
-
- ->appendFile($this->baseUrl."/js/jquery.datePicker.js")-& gt ;appendFile(
- $this->baseUrl."/js/demo.js");echo
- $this->headScript(); ?>
-
- 'bodywrapper'>
-
< divid=
- 'header' >
-
echo$this
- ->partial('header.phtml','default'
- );?> 'leftside .phtml','default');?>