0
votes

I created a hook in codeigniter framework, but it show me Unable to locate the specified class: Session.php. How can I fix this?

Here is my hook that I created

<?php
defined('BASEPATH') OR exit('No direct script access allowed');


$hook['pre_controller'] = array(
    'class'     => 'Demo',
    'function'  => 'test',
    'filename'  => 'Demo.php',
    'filepath'  => 'hooks',
);

Here is the Class that i call from the hook

<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class Demo extends CI_Controller {

    public function test() {
        echo 'it works';
    }

}
1

1 Answers

0
votes

a hook cannot extend CI_Controller, especially pre_controller. remove extends CI_Controller