Hi,
I am using a custom Config file. I populate its static variables by calling a method & then use those variables in BaseController. Its working fine in BaseController but when I try to use those same variables in AdminController extended from BaseController its variables show empty. I don't call the method to populate its variables in AdminController as its extended from BaseController.
Following are details. Kindly help me understand why config file variables don't show any value in AdminController:
BaseController
PHP Code:
$this->config = config('My_config');
// Following load_values() method loads users names & populates other static variables (eg: $users_array) of config class 'My_config'. I dont call this method again in AdminController
$this->config::load_values();
echo $this->config::$users_array[0]; // Prints User Name
AdminController extends BaseController
PHP Code:
$this->config = config('My_config');
echo $this->config::$users_array[0]; // Empty
$this->config::$users_array[0]; prints values in BaseController but don't print anything in AdminController. Please advise.
Regards