Welcome Guest, Not a member yet? Register   Sign In
creating and using config values

We have a large CI app that is running but we need to make some global changes depending on the server and specific application we are running. One of the things I would like to do is setup a small selection of $config variables and use them to build other config variables so any changes we need to make only has to be in one place. An example: (in config directory)
$config['app_company'] = "New Company";
$config['app_name'] = 'testapp';
$config['app_domain'] = 'newcompany.com';

$config['protocol'] = 'smtp';
$config['smtp_host'] = 'smtp.' . $config['app_domain'];

This works as long as it is in the config.php but doesn't if it is a seperate file. You can't use $this->config->item() call because in the config files you don't have an object defined.

Does anyone have a solution for this?

Autoload the new config file and it will be added to the configuration.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

Theme © iAndrew 2016 - Forum software by © MyBB