Search code examples
codeigniter-2

Codeigniter 2.0 Can not extend core library


not sure what is the problem? My class that is in Application/core folder, and here it is:

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

class MY_Image_lib extends CI_Image_lib {

    public function __construct() {
        parent::__construct();
    }

    function tesit($msg) {
        log_message('error', $msg);
    }

}

I get this error :

Fatal error: Call to undefined method CI_Image_lib::testit()

when I call it like this : $this->image_lib->testit('not working');

What I am missing, this is so strange.


Solution

  • Only the following classes are core classes all others should be extended in library folder.

    http://ellislab.com/codeigniter/user-guide/general/core_classes.html

    Benchmark
    Config
    Controller
    Exceptions
    Hooks
    Input
    Language
    Loader
    Log
    Output
    Router
    URI
    Utf8