CodeIgniter - accessing $config variable in view CodeIgniter - accessing $config variable in view codeigniter codeigniter

CodeIgniter - accessing $config variable in view


$this->config->item() works fine.

For example, if the config file contains $config['foo'] = 'bar'; then $this->config->item('foo') == 'bar'


Also, the Common function config_item() works pretty much everywhere throughout the CodeIgniter instance. Controllers, models, views, libraries, helpers, hooks, whatever.


You can do something like that:

$ci = get_instance(); // CI_Loader instance$ci->load->config('email');echo $ci->config->item('name');