My custom Library not loading through auto loading or through manual code. I checked this one and Documentation.
library/Faq.php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Faq {
public function __construct(){
$this->load->model('Faq_model');
}
public function recentFaqs(){
return $this->Faq_model->getFaqs();
}
}
Loaded the library $this->load->library('faq');
Called its function $this->faq->recentFaqs();
I got the following error A PHP Error was encountered
Severity: Notice
Message: Undefined property: Faq::$faq
Filename: controllers/Faq.php
Line Number: 17