Codeigniter class not found


Codeigniter class not found : This error occurs basically when your file name and class name does not match.


Suppose you have a controller file named as “User.php” and your class is something different then it will not work.

example :
File name : “User.php”


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

class Users extends CI_Controller {

      

}
?>

It will not work because your class name is “Users” instead of “User”

Correct Class name :


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

class User extends CI_Controller {

      

}
?>

This Will Work perfectly.

Make Sure you Are “User” not “user” because of case sensetive.


Advertisements

Add Comment

📖 Read More