Config Item Not Working On Hooks |
Hello I am not sure what I have done wrong with my Hooks
On any other controller if I use $this->config->item('maintenance') or config_item('maintenance') It returns the correct value 1 if maintenance mode on or 0 for off. How ever when I try to load it into my hook with $this->CI->config->item('maintenance') or config_item('maintenance') It does not work. Any suggestion on how to be able to use config item in hooks? Hook PHP Code: <?php PHP Code: $hook['pre_controller'] = array(
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
config_item() should work.
get_instance() can't work before a controller is instantiated.
(02-03-2016, 02:27 AM)Narf Wrote: config_item() should work. When I use config_item('maintenance') it seems to only work with post_controller and not pre_controller
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
(02-03-2016, 02:32 AM)wolfgang1983 Wrote:(02-03-2016, 02:27 AM)Narf Wrote: config_item() should work. Something else is wrong, not config_item(). CI itself uses this function even before 'pre_system'.
(02-03-2016, 02:35 AM)Narf Wrote:(02-03-2016, 02:32 AM)wolfgang1983 Wrote:(02-03-2016, 02:27 AM)Narf Wrote: config_item() should work. In stead of creating a library to set a config item. At the bottom of my config.php file I now do this PHP Code: require_once (BASEPATH . 'database/DB.php'); And then when I use this config_item('maintenance') it now full works fine.
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
|
Welcome Guest, Not a member yet? Register Sign In |