Change language dynamically in CodeIgniter 4 |
Hi,
How can I assign config("App")->defaultLocale in a controller function? So I can use it dynamically without changing the value in Config/App.php Thanks in advance.
Instead of changing the default, you can change it using the request with "$this->request->setLocale()". You can also retrieve the current one with "$this->request->getLocale()"
(https://forum.codeigniter.com/post-38167...#pid381677 and https://codeigniter.com/user_guide/outgo...ent-locale) |
Welcome Guest, Not a member yet? Register Sign In |