• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change dynamically setting variables

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?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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