I have developed a multilingual site for a real estate application and now that I need to display the flags I am wondering what would be the best approach to include the parameter.
I know that at first seems quite an easy task but it is not as I am using $_GET and $_POST and I do not know when that is happening as that depends if the user is searching for properties or not. When a user makes a search I collect posted data and created a custom CListView widget that renders the pagination according to user submission. This pagination needs to maintain its dataSource even though I click on a flag.
I would like it to be http://lang.domain.com/allthequerystring (but remember I need to maintain old URL strings there, when a user submits a search, the $_POST parameters need to be attached!, and when the pagination is clicked, then the $_GET parameters)
not bad no… but, that means I need to rebuild all my createUrl links throughout my application?
Thanks jacmoe! Your forwarded me to the right direction. After reading the classes of phundament, I have found http://www.yiiframework.com/extension/langhandler/ which holds some rules within that I think are what I am looking for…
My doubt is how to not do the double task of rewriting all my createUrl statements. I can already do it but I want to re-create the links without the need of touching the rest of my application code.
then I created my own component to handle the language parameters (just like the ELangHandler extension does)
next step was to handle urls in the main.php config file
i.e. (this works for all, I do not need to put as many as phundament does thanks to ELanghandler extension again; great job qian with this, easy, clean, very good job)