user5423926
user5423926

Reputation:

Fatal error: Call to a member function library() on a non-object

I'm using CodeIgniter and when my code try to load

$this->load->library('session');

I get this error:

A PHP Error was encountered

Severity: Notice

Message: Undefined property: Appointments::$load

Filename: controllers/appointments.php

Line Number: 7

I don't know how to fix this? What's the cause? I should provide something else?

Upvotes: 4

Views: 10065

Answers (1)

Niranjan N Raju
Niranjan N Raju

Reputation: 11987

I can tell that this error is inside constructor.

Constructor should be like this,

public function __construct()
{
    parent::__construct();// you have missed this line.
    $this->load->library('session');
}   

Upvotes: 12

Related Questions