Welcome Guest, Not a member yet? Register   Sign In
Load a config variable in separate config file

Hi guys
I've tried doing the following, but doesn't work

/* config/otherconfig.php */
$config['my_dir'] = $this->config->system_url().'/hello/blah/';

I then store the otherconfig.php file under config/ and make it autoload

I understand that $this->config->system_url() may not be available in the config files, because it may have not been loaded by CI yet.

Is there any way to workaround this? I want to have all my variables in sep. config file, with the possibility to build some variables from the orig. CI config file and store in this new config file.

Hope you've understood me


Try the constant 'APPPATH'. It is the path to your application folder.

Theme © iAndrew 2016 - Forum software by © MyBB