Routing in Zend Framework of two modules
I have created controller : module/default/index/login I have added routing in main bootstrap
$router = Zend_Controller_Front::getInstance()->getRouter();
$ro开发者_如何学编程ute = new Zend_Controller_Router_Route(':action', array(
'module' => 'default',
'controller' => 'index',
));
$router->addRoute('defaulth', $route);
When i accessing url/login it work fine
After that I have created another controller : module/user/index/register
When i access url/user/register it return error invalid action
When i access url/user/index/register it works fine.
I have to access with url/user/register
Please suggest any one.
I don't know if the name of the route was voluntary (defaulth
), but with default
you'll overwrite ZF's default main routing, which is :module\:controller\:action\*
.
Try :controller\:action\*
as the route.
精彩评论