CodeIgniter Forums
Load a config variable in separate config file - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Load a config variable in separate config file (/showthread.php?tid=20912)



Load a config variable in separate config file - El Forum - 07-25-2009

[eluser]CARP[/eluser]
Hi guys
I've tried doing the following, but doesn't work

Code:
/* 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

Thanks,


Load a config variable in separate config file - El Forum - 07-25-2009

[eluser]davidbehler[/eluser]
Try the constant 'APPPATH'. It is the path to your application folder.