CodeIgniter Forums

Full Version: Change dynamically setting variables
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?