Archive | Zend Framework

Zend Framework vhost settings

Jun 14th, 2011No Comments

Zend Framework vhost settings for xampp server or lampp server

Add the below code in  httpd-vhosts.conf in \xampp\apache\conf\extra  and modify the paths

<VirtualHost *:8081>
 php_value include_path ".;C:\xampp\htdocs\public;C:\xampp\htdocs\PhpProject2\library"
 DocumentRoot "C:\xampp\htdocs\PhpProject2\public"
 <Directory "C:\xampp\htdocs\PhpProject2">
 AllowOverride All
 Order allow,deny
 Allow from all
 </Directory>
</VirtualHost>

and then add Listen 8081 in httpd.conf file located at xampp\apache\conf

and restart your xampp server ..

VN:F [1.9.10_1130]
Rating: 10.0/10 (3 votes cast)
VN:F [1.9.10_1130]
Rating: +2 (from 2 votes)

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: 8.4/10 (7 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)