• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Switch Language

#1
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.
Reply

#2
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(); 
And my problem is completely solved. Cool
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.