Welcome Guest, Not a member yet? Register   Sign In
Change dynamically setting variables
#1

Hi to everybody! I need to change the 'defaultLocale' var from a controller, in codeigniter 3 I couldĀ do that simply with this line:

$this->config->set_item('language', $lang);

But in Codeigniter4 if try to do this:

config('Config\\App')->defaultLocale = $lang;

The value of the global config don't change...

How can i do this? With the function config() i'm accessing to the global config or to a new instance of config?

Thx!
Reply


Messages In This Thread
Change dynamically setting variables - by AleJSON - 04-06-2021, 10:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB