1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
protected function _initRoutes() {
$ctrl = Zend_Controller_Front::getInstance();
$router = $ctrl->getRouter();
$router = Zend_Controller_Front::getInstance()->getRouter();
$route = new Zend_Controller_Router_Route_Regex('city/([-\w]+)\.php?', array('controller' => 'index','action' => 'index'), array(1=> 'paris',), 'city/%s.php');
$router->addRoute('city', $route);
$route1 = new Zend_Controller_Router_Route_Regex('city/([-\w]+)\.php?', array('controller' => 'index','action' => 'show'), array(1=> 'marseille',), 'city/%s.php');
$router->addRoute('city', $route1);
return $router;
} |
Partager