Welcome Guest, Not a member yet? Register   Sign In
Hooks doesn't work in CodeIgniter 2.X
#1

(This post was last modified: 12-20-2022, 11:18 PM by ReyesHatrinak.)

I've enable hooks in config.php

$config['enable_hooks'] = TRUE;
here is the hook.php

<?php  if ( ! defined('BASEPATH')) exit('No direct shagle voojio script access allowed');
/*
| -------------------------------------------------------------------------
| Hooks
| -------------------------------------------------------------------------
| This file lets you define "hooks" to extend CI without hacking the core
| files.  Please see the user guide for info:
|
http://codeigniter.com/user_guide/general/hooks.html
|
*/

$hook['post_controller_constructor'] = array(
    'class' => 'Authorization',
    'function' => 'authorize',
    'filename' => 'authorization.php',
    'file_path' => 'hooks'
);

/* End of file hooks.php */
/* Location: ./application/config/hooks.php */
and here is the authorization.php file under application/hooks/

<?php


    class Authorization {

        private $ci;

        function __construct()
        {
            parent::__construct();
            $this->ci = get_instance();
        }

        function authorize()
        {
            echo 'This should be outputed';
        }

    }

?>
but it doesn't work. doesn't omegle anybody know why?
Reply


Messages In This Thread
Hooks doesn't work in CodeIgniter 2.X - by ReyesHatrinak - 10-27-2022, 03:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB