ok this is might be more then what you are looking for,
but this is a way to put site wide configs in one file, and then easily have them available
in config folder you have file: my_custom_settings.php
in that file you want to set a config value like:
$config['TEMPLATE_DIR'] = 'assets/front' ;
$config['site_slogan'] = 'Laravel? Never heard of it' ;
create another file called: My_custom_settings.php
put that file in: application/library/My_custom_settings.php
that file will contain:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class My_custom_settings
{
function __construct($config = array() )
{
foreach ($config as $key => $value) {
$data[$key] = $value;
}
// makes it possible for CI to use the load method
$CI =& get_instance();
// load the config variables
$CI->load->vars($data);
}
} // end my custom settings
now in your controller constructor
public function __construct() {
parent::__construct();
// Load configs for controller and view
$this->load->library( 'my_custom_settings' );
$this->config->load( 'my_custom_settings' );
} // end construct
Now for the cool part -- anything you put in that config file, will be available for your controller and views. ( you can load config in a model constructor as well ).
in a controller or model you get the value with $this->config, like
$this->config->item( 'site_slogan' )
a little awkward, but for views, heres the reward, you only need the config name
echo $TEMPLATE_DIR . '/somefile' ;
defined variable??<img src="<?=IMG_PATH?>/images/user.jpg">