Switch Language |
I'm turning my current english only site to a multi-lingual site (currently LtR only, but RtL comming at a later date), but i hit one small snag.
My current language switching method is using a route. the url that the user follows is 'settings/SetLanguage/english' After the language switch, the user is back at the index page. How can i make sure the user is back at the page it switched the language on.
I'm going to answer my own question here.
In my SetLanguage route i added the following line as last line PHP Code: redirect($this->session->current_url); In my controller(s) i just add the following line to the constructor PHP Code: $_SESSION['current_url'] = $this->uri->uri_string(); ![]() |
Welcome Guest, Not a member yet? Register Sign In |