• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] Database Driven Config Question

#2
Hi,

You could use a post_controller_constructor hook
Where you have access to CI super object.

Hook.php
PHP Code:
$hook['post_controller_constructor'] = array(
 
       'function' => 'config_hook',
 
       'filename' => 'hook_config.php',
 
       'filepath' => 'hooks'
 
   ); 

hook_config.php
PHP Code:
function config_hook()
{
 
   $CI =& get_instance();
 
   $uri_string $CI->uri->uri_string();
 
   $CI->db->where('field''value');
 
   $query $CI->get('table');
 
   // etc..
 
   


Don't forget to enable hooks in config.php
A good decision is based on knowledge and not on numbers. - Plato

Reply


Messages In This Thread
RE: Database Driven Config Question - by salain - 08-17-2017, 04:42 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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