I have a welcome controller, which allows the user to choose a language (en or fr) which then points to it’s respective controller (en or fr) so the url looks like this http://www.xxx.com/en/func/func. I would like so that there can be a link that can change the language, and I would like it to switch language but stay at the same page. Simply grab the corresponding language lines from the proper language files.
Which is the best way to do this?
You should use routing for this, in your
routes.phpyou should add this:Then in your default controller you could find the rsegment and use it against whatever you need.
In practical: