[Zend_Framework] Zend_Layout and Bootstrapping
Posted: Mon Jun 29, 2009 5:40 pm
Hello,
It is correct to do this:
In my config i have:
If is not correct, can you please give me a different approach?
It is correct to do this:
Code: Select all
<html>
<head>
<?php
$bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');
$view = $bootstrap->getResource('View');
$request = $bootstrap->getResource('FrontController')->getRequest();
$this->headTitle($view->title);
$this->headTitle()->setSeparator(' / ');
$this->headTitle($request->getActionName())
->headTitle($request->getControllerName());
echo $this->headTitle();
$this->headScript()->appendFile($view->pathCss.'javascript.js');
echo $this->headScript();
$this->headStyle()->appendStyle($view->pathCss.'style.css');
echo $this->headStyle();
?>
</head>
<body>
<?php echo $this->layout()->content; ?>
</body>
</html>
Code: Select all
resources.view.params.title = "My application"
resources.view.params.pathCss = "/public/css/"
resources.view.params.pathImg = "/public/img/"
resources.view.params.pathJs = "/public/js/"
resources.view.params.doctype = "HTML4_STRICT"
resources.view.params.charset = "utf-8"
If is not correct, can you please give me a different approach?