• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hooks won't work

Hello and I would like to start off by saying that I love the CI Framework.. I've done some searching in the forums... and I can't find the answer to what I'm looking for..

I am using the module separation style of CI and I am trying to use hooks but for some reason it won't work.

I followed the user guide to set it up.. I also tried some examples in the forums.

Here is what I've got..

config.php file:

$config['enable_hooks'] = true; // enable hooks

$config['subclass_prefix'] = 'MY_'; // this is what my classes are set to.. for module separation

hooks.php file:

$hook['pre_controller'] = array(
'class' => 'MY_test',
'function' => 'checkit',
'filename' => 'MY_test.php',
'filepath' => 'hooks',
'params' => array('bob','tom')

so my file MY_test.php is in the application/hooks/ directory. and all I am trying to do is echo a message for now.. I also tried to return the message.. to see if it would display something.. but it doesn't..

My page shows blank :long:

I checked my log file because that is set to 4 to get all messages.. and it just says..

DEBUG - 2007-10-16 15:48:59 --> Config Class Initiallized

that is it.. also I don't see any php errors or notices.. not sure why that is..

any help would be greatful..


assuming this is a copy paste of the hook:
Quote:$hook[’pre_controller’] = array(
‘class’ => ‘MY_test’,
‘function’ => ‘checkit’,
‘filename’ => ‘MY_test.php’,
‘filepath’ => ‘hooks’,
‘params’ => array(’bob’,’tom’)

the problem looks to be a parse error - at the end of the hook block you have a curly brace } instead of a parenthesis )


man thanks !!!!!!!!!

you know how long I've been looking at the code... and didn't notice that.....

I feel so dumb.... sometimes it just takes another set of eyes...

thanks... so much..

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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