Links

URL Rewriting in zend framework

$front = Zend_Controller_Front::getInstance();


/* Check in you project $front may be differ for Zend_Controller_Front::getInstance();
now suppose we have to convert path mysite.com/user/profile/of/gauravstomar
to mysite.com/users/gauravstomar
then you need to define a route here it is $route */


$route = new Zend_Controller_Router_Route('users/:of',array('controller'=>'user','action'=>'profile'));

// here :of represents the of parameter of the url
// and put it in

$front->getRouter()->addRoute('users', $route);

Post a Comment