Thiago Bittencourt
Thiago Bittencourt

Reputation: 492

CodeIgniter - Class 'CI_Loader' not found

I'm trying to extend CI_Loader class to override _ci_load_library(), but I'm receiving:

Fatal error: Class 'CI_Loader' not found in C:\Users\X\workspace\ci-app\application\core\MY_Loader.php on line 4
A PHP Error was encountered
Severity: Error

Message: Class 'CI_Loader' not found

Filename: core/MY_Loader.php

Line Number: 4

Backtrace:

The class MY_Loader is located in application/core/MY_Loader.php, and it's like this:

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


class MY_Loader extends CI_Loader
{
    public function __construct()
    {
        parent::__construct();
    }

    protected function _ci_load_library($class, $params = NULL, $object_name = NULL)
    {
        // ...
    }
}

I'm using the latest version of CodeIgniter: 3.1.9

Upvotes: 0

Views: 1457

Answers (1)

Leena Patel
Leena Patel

Reputation: 2453

Try Adding below line above declaration of class MY_Loader

 require APPPATH."../system/core/Loader.php";

Upvotes: 1

Related Questions