路由中的多控制器如何工作?我的路线:
$router->addRoute(
'index',
new Zend_Controller_Router_Route('/:lang/:@action',
array(
'lang' => 'en',
'module' => 'default',
'controller' => 'index',
'action' => 'index'
)
)
);
此路由适用于索引控制器,但不适用于身份验证控制器。如何使用该路由和索引身份验证控制器?
我的菜单项:
$this->url(array('controller'=>'Auth','action'=>'index')
这个菜单项,不起作用。我的完整函数 _initRoutes()
protected function _initRoutes(){
$frontController = Zend_Controller_Front::getInstance();
$router = $frontController->getRouter();
$router->removeDefaultRoutes();
$router->addRoute(
'fullRoute',
new Zend_Controller_Router_Route('/:lang/:module/:controller/:action',
array('lang' => ':lang')
)
);
$router->addRoute(
'languageControllerAction',
new Zend_Controller_Router_Route('/:lang/:controller/:action',
array('lang' => ':lang')
)
);
$router->addRoute(
'index',
new Zend_Controller_Router_Route('/:lang/:@action',
array(
'lang' => 'en',
'module' => 'default',
'controller' => 'index',
'action' => 'index'
)
)
);
}
我需要控制器身份验证操作的路线。