Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal error: Class 'CI_Model' not found in

My problem is to make super model class with common functions for routines with models(findByPk, FindByAttributes and so on).

For thjs I decided to make new library that extends CI_Model class and to extend all models from MY_Model class.

So I added MY_Model to $autoload['libraries'] array.

When adding model to this array I've got error:

Unable to load the requested class: Model

But main problem is that on application start I get:

Fatal error: Class 'CI_Model' not found

CI_Model class in core folder exist. So please say What maybe the explanation "why I cant extend CI_Model class in my library with MY_Model!"

like image 837
user3240998 Avatar asked Jan 29 '14 17:01

user3240998


1 Answers

use

$autoload['models']

for loading models automatically, instead of $autoload['libraries']

like image 167
Keerthi Menon Avatar answered Oct 13 '22 23:10

Keerthi Menon