I am trying to write a hook for my Codeigniter application.
I am trying to catch session in my hook .
Here is my hook download code:
$hook['pre_controller'] = array( 'function' => 'getNav', 'filename' => 'LoadNav.php', 'filepath' => 'hooks' );
And here is the code I'm trying to load into hook:
function getNav() { $CI =& get_instance(); $level = $CI->session->userdata('level'); }
He continues to throw an error, which is as follows:
A PHP Error was encountered Severity: Notice Message: Trying to get property of non-object Filename: hooks/LoadNav.php Line Number: 7
Any idea what I'm doing wrong? Does the get_instance method seem to not work correctly?
Any help would be appreciated, Thanks
Alain
source share