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);

}
VN:F [1.9.10_1130]
Rating: 7.5/10 (8 votes cast)
VN:F [1.9.10_1130]
Rating: +3 (from 3 votes)

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(); ?>
VN:F [1.9.10_1130]
Rating: 10.0/10 (3 votes cast)
VN:F [1.9.10_1130]
Rating: +3 (from 3 votes)
Page 3 of 3«123