php - Codeigniter - Failing to load config
In my code, According to the user guide, I write this code (In a controller)
$this->config->load('countries_config.php');
But unfortunately, get this PHP error:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Countries::$config
Filename: controllers/Countries.php
Line Number: 12
Any idea why I can't use the config?
Countries
extendsCI_Controller
Answer
Solution:
without .php extensions
try this
Answer
Solution:
what is counteries_config.php is this controller,model or view file $this->config->load('filename');
Answer
Solution:
OK, the problem occured because I was trying to load the config file before doing
parent::_construct();
Fixed by doing it after