我为admin/login/
'adminLogin' => new Zend_Controller_Router_Route(
'admin/login/',
array('controller' => 'index', 'action' => 'login', 'module' => 'admin')
),
现在让我们来看看我正在调用路由器的assemble()
函数的控制器:
class Admin_Controller_Index extends Zend_Controller_Action
{
public function loginAction() {
echo Zend_Controller_Front::getInstance()->getRouter()->assemble(
array(
'controller' => 'index',
'action' => 'authentificate',
'module' => 'admin'
)
);
// will output /admin/login
//any other plays with assemble() function will always return /admin/login
//Why???
exit;
}
public function authenitifcateAction() {
echo Zend_Controller_Front::getInstance()->getRouter()->assemble(
array(
'controller' => 'index',
'action' => 'authentificate',
'module' => 'admin'
)
);
//will output /admin/index/authentificate as expected
//any other plays with assemble() function will aslo return expected values
exit;
}
}
因此,如果在控制器的具有命名路由的操作中调用,assemble()
将始终返回意外值。
我做错了什么?