2010年4月28日星期三

[fw-mvc] RE: Language in URL: always a particular case !

Hello,

Thanks for your help, it's almost ok but there is still a problem.
I don't know exactly the order to define routes.

For example, i've created a very simple app with two modules, front and
admin. Front module has a IndexController with an index action and Admin
module has a ContactController with an index action.

According to the ZF documentation i should have :
[code]
resources.router.routes.m.route = "/:locale/:module"
resources.router.routes.m.defaults.module = front
resources.router.routes.m.defaults.controller = index
resources.router.routes.m.defaults.action = index
resources.router.routes.m.reqs.locale = "^([a-z]{2}-[a-z]{2})$"
resources.router.routes.m.defaults.locale =

resources.router.routes.mc.route = "/:locale/:module/:controller"
resources.router.routes.mc.defaults.module = front
resources.router.routes.mc.defaults.controller = index
resources.router.routes.mc.defaults.action = index
resources.router.routes.mc.reqs.locale = "^([a-z]{2}-[a-z]{2})$"
resources.router.routes.mc.defaults.locale =

resources.router.routes.ca.route = "/:locale/:controller/:action"
resources.router.routes.ca.defaults.module = front
resources.router.routes.ca.defaults.controller = index
resources.router.routes.ca.defaults.action = index
resources.router.routes.ca.reqs.locale = "^([a-z]{2}-[a-z]{2})$"
resources.router.routes.ca.defaults.locale =

resources.router.routes.default.route =
"/:locale/:module/:controller/:action"
resources.router.routes.default.defaults.module = front
resources.router.routes.default.defaults.controller = index
resources.router.routes.default.defaults.action = index
resources.router.routes.default.reqs.locale = "^([a-z]{2}-[a-z]{2})$"
resources.router.routes.default.defaults.locale =
[/code]

But with the url : http://local.cosplay-it-teasing.com/en-us/dsqdqs
I don't get a Invalid controller exception and
http://local.cosplay-it-teasing.com/en-us/index or
http://local.cosplay-it-teasing.com/en-us/index/index don't work either.

If i change order of routes i can obtain it, but :
http://local.cosplay-it-teasing.com/en-us/admin/contact
Throws an Invalid Controller exception when the module/controller exist.

Any idea ?

Except that i think that's a better way to redirect earlier from bootstrap
or application plugin resource rather than from a controller plugin.


Thanks.

Cdt,
Benjamin.
--
View this message in context: http://zend-framework-community.634137.n4.nabble.com/Language-in-URL-always-a-particular-case-tp2067501p2072857.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: