He said they come from the database. Not all settings belong in a config file. Most clients don't have the ability to go editing php files.
I do something like that with application specific config settings. I just create a library that triggers a method in __construct() that gets the data from the db and creates variables from them. That library gets autoloaded so the variables are available globally.
It's fairly basic...something like:
PHP Code:
class Site_settings {
//holds the CI instance
protected $CI;
//the array the settings will be stored as
public $site_config = array();
//
public function __construct()
{
//load CI instance
$this->CI =& get_instance();
//fire the method loading the data
$this->init();
}
public function init()
{
//load the model that gets the data
$this->CI->load->model('site_config_model');
//retrieve/set the data
$this->site_config = $this->CI->site_config_model->get_settings(); //returns an associative array of config settings
}
}
Now if you autoload the site_settings library, $this->site_config is the array that's available to all other controllers/models/views/etc.
PHP Code:
echo $this->site_settings['company_slogan'];