1

I moved a custom addon out of system/third_party into a third_party folder above web root

all was well until I realized that the addon didn't account for a different third_party folder location

I updated the paths but now I'm having some strange issues with EE not loading custom config files

I'm loading the these files in the constructor of the mcp file.

$this->_EE->load->add_package_path(PATH_THIRD . 'custom_addon/');
$this->_EE->load->config('custom_addon');

the config files seem to load fine (I don't get any errors) but I can't access the config items in the file

$this->_EE->config->item('some_value');

doesn't return anything

any idea what's up?

EE2.6.1

1 Answer 1

1

I've not used load->config but all the other load commands allow for a second parameter:

$this->EE->load->model('filterdb_model', "filterDB");
$modules = $this->EE->filterDB->get_installed_modules($moduleName);

So the second parameter is the reference to the class. But reading the CI documentation for config doesn't seem to behave the same - it expects a boolean :(

Personally I just do this:

require PATH_THIRD.strtolower(get_class($this)).'/config/config.php';
$this->name = $config['name'];
$this->version = $config['version'];

CI Docs

Forums

Another CI reference

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.