PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, January 28, 2022

[FIXED] Unable to locate the specified class in codeigniter Session.php

 January 28, 2022     codeigniter, php     No comments   

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
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing