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

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

#2
[eluser]TheFuzzy0ne[/eluser]
I don't think there's any sensible way to do it, other than to do this:

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

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

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

#4
[eluser]TheFuzzy0ne[/eluser]
No such luck I'm afraid...

#5
[eluser]Dam1an[/eluser]
Could you not do something like
Config:
Code:
$config['active_group'] = "default";

Database:
Code:
$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)

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

Code:
$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  


Users browsing this thread:
1 Guest(s)


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