Not able to load a custom CodeIgniter library sharing the same name as the controller which loads it [closed]
I am unable to load my custom library through auto-loading or through manual loading. I checked this one and Documentation. library/Faq.php class Faq { public function __construct() { $this->load->model('Faq_model'); } public function recentFaqs() { return $this->Faq_model->getFaqs(); } } In my Faq controller, I loaded the library with $this-load->library('faq'); and called its method with $this->faq->recentFaqs();, but I got the following error: A PHP Error was encountered Severity: Notice Message: Undefined property: Faq::$faq Filename: controllers/Faq.php Line Number: 17
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.