在zend框架中链接几个路由

时间:2011-03-15 09:42:51

标签: zend-framework zend-route

我怎样才能使这两条路线(语言,amdin)工作..单独的管理员,或语言可以工作但是它们会一起失败:(

; Admin route
resources.router.routes.admin.type = Zend_Controller_Router_Route
resources.router.routes.admin.route = ":admin"
resources.router.routes.admin.reqs.admin = "admin"

; Language route
resources.router.routes.language.type = Zend_Controller_Router_Route
resources.router.routes.language.route = ":language"
resources.router.routes.language.reqs.language = "^(nl|en)$"
resources.router.routes.language.defaults.language = "nl"

; Default route chain
resources.router.routes.default.type = Zend_Controller_Router_Route_Chain
resources.router.routes.default.chain = "language, admin, defaultmodule"

1 个答案:

答案 0 :(得分:1)

嗯,当然。 这些路线是重叠的,虽然它们应该是不同的。

; Admin route
...
resources.router.routes.admin.route = "admin/:admin"
...