CodeIgniter Forums
how to get database 'active_group' value in a controller? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: how to get database 'active_group' value in a controller? (/showthread.php?tid=2601)



how to get database 'active_group' value in a controller? - El Forum - 08-14-2007

[eluser]litzinger[/eluser]
How do I get the value of the 'active_group' variable in the database.php file in a controller? I need to turn off certain functionality of my site if I'm in the development environment.


how to get database 'active_group' value in a controller? - El Forum - 08-16-2007

[eluser]litzinger[/eluser]
Ok, I just used:

Code:
if($this->db->hostname != 'mydevhost'){
//do something
}

This does the trick, though I'd still like to know if there is a way to reference the active_group in a controller, view, or model.