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

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.php
$config['app_company'] = "New Company";
$config['app_name'] = 'testapp';
$config['app_domain'] = 'newcompany.com';

email.php
$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?
Reply


Messages In This Thread
creating and using config values - by lhelber - 03-10-2015, 08:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB