Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter 2 Hooks Not Working
#1

[eluser]gidarren[/eluser]
Hey all, I am using CodeIgniter 2 and hooks are not working... my hook isn't being activated at all.

I have hooks activated:
Code:
$config['enable_hooks'] = TRUE;

I have enable my hook in hooks.php:
Code:
$hook['post_controller_constructor'] = array(
                                'class' => 'Authorization',
                                'function' => 'authorize',
                                'filename' => 'Authorization.php',
                                'filepath' => 'hooks'
                          );

And finally I have my hook:
Code:
class Authorization {
    
    private $CI;

    function __construct()
    {
        $this->CI = get_instance();
    }
    
    function authorize()
    {
        echo 'This should be outputted!';
    }
}

Does anyone know if I am doing anything wrong? The documentation does not provide a clear example.

Thanks,
Darren
#2

[eluser]gidarren[/eluser]
Sorry guys, was a filename issue; make sure you know if you are using lowercase or uppercase.




Theme © iAndrew 2016 - Forum software by © MyBB