I\'ve read all the post I found regarding this issue but nothing works. I\'m using Codeigniter 2.02 in a LAMP with Apache2.2 and PHP5.3.2
I\'m trying to create a common
Take a look at this post from Phil Sturgeon:
http://philsturgeon.co.uk/blog/2010/02/CodeIgniter-Base-Classes-Keeping-it-DRY
The key is using the native autoload as explained in his post:
/*
| -------------------------------------------------------------------
| Native Auto-load
| -------------------------------------------------------------------
|
| Nothing to do with cnfig/autoload.php, this allows PHP autoload to work
| for base controllers and some third-party libraries.
|
*/
function __autoload($class)
{
if(strpos($class, 'CI_') !== 0)
{
@include_once( APPPATH . 'core/'. $class . EXT );
}
}
NOTE
As a note, you'll want to put all of your "base" controllers in the core
folder for CI2+