How can I access a CodeIgniter configuration variable from a model/controller? How can I access a CodeIgniter configuration variable from a model/controller? codeigniter codeigniter

How can I access a CodeIgniter configuration variable from a model/controller?


Try:

$this->load->database();echo $this->db->dbprefix;

Normally you can use $this->config->item but I think that only allows variables set in $config


The documentation says you should be using:

$this->db->dbprefix('tablename');

Doesn't make a huge amount of difference but could be an easier syntax.