Archive | PHP
Zend Framework Router example
May 6th, 2011No Comments
Zend Framework Router implementation in bootstrap
protected function _initRouter(){
$front = Zend_Controller_Front::getInstance();
$router = $front->getRouter();
$default_route = new Zend_Controller_Router_Route_Static(
'home',
array('controller' => 'index', 'action' => 'index')
);
$router->addRoute('home', $default_route);
}
Add stylesheets to the layout from the bootstrap
May 1st, 2011No Comments
You need to append stylesheets to the headlink
First you need to add the below code in you bootstrap.php
<?php
protected function _initStylesheet() {
$view = new Zend_View ( $this->getOptions () );
// retreives the css file names in and object array
$view->headLink ()->appendStylesheet ('csspath1');
$view->headLink ()->appendStylesheet ('csspath2');
return $view;
}
?>
And then add the below code before the </head> tag in your layout
<?php echo $this->headLink(); ?>
Yep.... I couldn't have said it better myself......