Welcome Guest, Not a member yet? Register   Sign In
[Solved] Database Driven Config Question
#2

(This post was last modified: 08-17-2017, 04:43 AM by salain.)

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



Theme © iAndrew 2016 - Forum software by © MyBB