I'm maintaining our application for a few months now, and I was
wondering if there was a better way to do this:
/:country/*
...where :country is a two-letter country code that maps to a default
locale for that country /[a-z]{2}/.
I've been trying to achieve a few rules that might help to streamline
our development and refactoring purposes, namely:
1. Keep the country parameter accessible in $this->params['country']
(I already have this in place)
2. Once the country parameter has been set, there should be no need to
set it again in $html->link(), $html->url(), or Router::url() calls.
Likewise, the method signatures on the controller actions do not need
a $country parameter, too.
3. If there is no country parameter set, the app will default to a
specific locale (en, for example) (I was also wondering if a redirect
to /us or /uk would be better if the country parameter was absent)
I need some ideas from you guys so I can go ahead an implement it in
our app. I've been experimenting with some variations to the routes
configuration, even tried to extend the HtmlHelper, but I'm not really
sure if it is the best way to go.
Thanks in advance. :)
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment