Search code examples
phpcodeigniter

Codeigniter 3 How to load library session from library path


i try to load library session from another file in library path, i use these code to load the library but its cannot work

class Gdrive_api
{
    public function __construct()
    {
    $this->load->library('session');
    }
}

Message Show

Undefined property ::$load


Solution

  • Finally i found the way to call another library from library path, it using get instance

    public function __construct()
    {
        $this->ci = &get_instance();
        $this->ci->load->library("session");
    }