Welcome Guest, Not a member yet? Register   Sign In
Config Static Variables Not Working
#11

(08-04-2021, 02:41 AM)paulbalandan Wrote: I think I have a guess on the problem but needs some confirmation.
Can you share the code of your My_config?

Class objects are saved by reference by default so changing one should affect the other. I just need to confirm the structure of your config class to know the culprit behind this.

Here is sample code for your illustration, just ignore there is user array in my question:

PHP Code:
namespace Config;
use 
CodeIgniter\Config\BaseConfig;

class 
My_config extends BaseConfig {

   public static $user '';

   public static function load_values() {

      self::$user "Any User Name";

   }



Reply


Messages In This Thread
Config Static Variables Not Working - by myo - 08-03-2021, 06:08 AM
RE: Config Static Variables Not Working - by myo - 08-03-2021, 08:08 PM
RE: Config Static Variables Not Working - by myo - 08-03-2021, 09:56 PM
RE: Config Static Variables Not Working - by myo - 08-03-2021, 10:37 PM
RE: Config Static Variables Not Working - by myo - 08-04-2021, 02:52 AM
RE: Config Static Variables Not Working - by myo - 08-04-2021, 09:03 AM
RE: Config Static Variables Not Working - by myo - 08-05-2021, 03:57 AM
RE: Config Static Variables Not Working - by myo - 08-06-2021, 06:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB