Issue
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';
}
}
Solution
a hook cannot extend CI_Controller
, especially pre_controller
. remove extends CI_Controller
Answered By - Alex
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.