Fatal error: Class 'CI_Model' not found in

codeigniter, fatal-error

Solution

use

$autoload['models']

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

Problem

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!"

Original source