Ive得到了一个网址: http://dev.local/foodies/view?id=bluedaniel
香港专业教育学院,并在我的引导了:
protected function _initRoute() {
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/routes.ini', 'production');
$router = new Zend_Controller_Router_Rewrite();
$router->addConfig($config, 'resources');
}
并且Ive也得到了我routes.ini:
[production]
resources.router.routes.foodies_view.route = ":foodies/:id"
resources.router.routes.foodies_view.defaults.module = "foodies"
resources.router.routes.foodies_view.defaults.controller = "view"
resources.router.routes.foodies_view.defaults.action = "index"
所以HTTP://dev.local/foodies/bluedaniel应该工作的权利?
我得到一个资源“美食家:bluedaniel”未找到错误然而与此设置
--------------- UPDATE ----------------
取而代之的是上述的添加以下到的application.ini文件:
resources.router.routes.myroute.route = "foodies/:id"
resources.router.routes.myroute.defaults.module = "foodies"
resources.router.routes.myroute.defaults.controller = "view"
resources.router.routes.myroute.defaults.action = "index"
resources.router.routes.myroute.defaults.id = "\w+"
这个方法现在工作虽然我仍然宁愿在自己单独的ini文件的路径,如果我能帮助它。