• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get $active_group?

[eluser]Jonas G[/eluser]
Quick question: Is it possible to get the $active_group defined in databases.php somehow?

I don't think there's any sensible way to do it, other than to do this:

include(APPPATH . 'config/database.php');

Then the $active_group variable will be available in the scope of the function where the file was included.

[eluser]Colin Williams[/eluser]
I would print_r($this->db) and hunt for it. Might be somewhere in there.

No such luck I'm afraid...

Could you not do something like
$config['active_group'] = "default";

$active_record = $this->config->item('active_group');

And then you can just get the value via the config class
(Note: This has not been tested, but should work non the less)

[eluser]Rob Corley[/eluser]
I just tried the above, and just for reference you need to do:-

$CI =& get_instance();
$active_group = $CI->config->item('active_group');

Inside database.php to be able to access the config variables.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.