我正在尝试定义与现有路线一起使用的语言路线。这个想法是使以下网址工作:
/en/dashboard/usability-testing/setup
/fr/dashboard/usability-testing/setup
问题是它们只能在没有语言(/dashboard/usability-testing/setup)的情况下工作,当然总是默认为英语。
这是我的 application.ini 路由定义:
resources.router.routes.defaultmodule.type = Zend_Controller_Router_Route_Module
resources.router.routes.defaultmodule.defaults.mod ule = "default"
resources.router.routes.testing.type = Zend_Controller_Router_Route
resources.router.routes.testing.route = "dashboard/usability-testing/:action/*"
resources.router.routes.testing.defaults.controlle r = "usability-testing"
resources.router.routes.testing.defaults.action = "index"
resources.router.routes.study.type = Zend_Controller_Router_Route
resources.router.routes.study.route = "dashboard/usability-study/:action/*"
resources.router.routes.study.defaults.controller = "usability-study"
resources.router.routes.study.defaults.action = "index"
resources.router.routes.language.type = Zend_Controller_Router_Route
resources.router.routes.language.route = ":language"
resources.router.routes.language.reqs.language = "^(ca|es|en|fr)$"
resources.router.routes.language.defaults.language = "en"
resources.router.routes.language.chain = "testing, study, defaultmodule"
resources.router.routes.default.type = Zend_Controller_Router_Route_Chain
resources.router.routes.default.chain = "language, defaultmodule"
有人可以帮忙吗?谢谢@avergess