0
我在这里遇到了一些问题。我目前正试图使用Zend路由器重写,但我得到这个错误:Zend Framework - 未指定参数
Fatal error: Uncaught exception 'Zend_Controller_Router_Exception' with message 'alias is not specified'
这里是我的路线代码:
// BLOG -> CATEGORIES -> LIST ARTICLES
$route = new Zend_Controller_Router_Route(
'/blog/categories/:alias',
array(
'module' => 'blog',
'controller' => 'categories',
'action' => 'list'
)
);
$router->addRoute('blog-categories-list', $route);
我想要访问的网址是:/blog/categories/general/
。
为什么我会收到此错误?
PS:我没有为:alias
指定一个默认值,因为我有这条路线也:
// BLOG -> CATEGORIES
$route = new Zend_Controller_Router_Route(
'blog/categories/',
array(
'module' => 'blog',
'controller' => 'categories',
'action' => 'index'
)
);
$router->addRoute('blog-categories', $route);