How to set default Locale {locale} on default redirected controller? |
Hi all! I have an app that works ok in different languages but want to filter and fix on home URL to append locale as
PHP Code: /*Filter class*/ I want if any incoming request should fall on eg: (www. example.com/en) and not (www. example.com) PHP Code: public function index(){ Codeigniter First, Codeigniter Then You!!
yekrinaDigitals
Well, On Routes.php you can assign {locale} for the homepage and maybe this easy approach might give you idea for the rest:
PHP Code: $lang = $this->request->uri->getSegment(1); //this is the language code part. So, it will automatically redirect to your default language, whatever it is..
IncludeBeer has a very nice tutorial on creating a Multi-Language web site for a Blog.
IncludeBeer Website What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |