开发者

change request uri before set controller and action in Zend

I am doing a web in开发者_如何转开发 Zend Framework. I wanna it for being multilanguage so in the structure controller/action I wanna add a uri parameter like this:

domain.com/en/controller/action

But obviusly Zend try to get controller with name en. How can I modify the requestUri before Zend set the controller name and the action name?

Thanks


You can create your own routes for this, begin with something like this in your application.ini:

resources.router.routes.default.route = ":language/:controller/:action"
resources.router.routes.default.defaults.controller = "index"
resources.router.routes.default.defaults.action = "index"

More information on the Zend website: The Standard Router

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜