CodeIgniter Forums

Full Version: BUG - autoloading user-created libraries
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all,

found an error with autoloading custom libraries, getting next error:

Fatal error: Class 'CI_Layout' not found in ...\system\core\Common.php on line 196

my class name is Layout

I explored this file, and found out it adds CI_ automatically to class name.

but if I change class name to CI_Layout, it tells me

"Non-existent class: Rb"
If it is your own library then it goes in ./application/libraries.
If it is a library that extends a CI library then it goes in ./application/core.

You never place your code in the CI system folder!
as InsiteFX said user created libraries go in : application/libraries

to auto load the library open: application/config/autoload.php

add the library name to the autoload['libraries'] array. EG: autoload['libraries'] = array('my_lib');

this is all covered in the documentation.