[eluser]Dan Horrigan[/eluser]
OK, if you want to use an autoloader, then at least do this:
Code:
function model_autoload($class)
{
if(stripos('_model', $class) !== FALSE)
{
include APPPATH . 'models/' . $class . EXT;
}
}
spl_autoload_register('model_autoload');
This way, it doesn't interfere with other autoloading (when CI gets it). It also makes sure it only loads models. Also, include_once is unnecessary, because the autoload method doesn't get called unless the clas doesn't exist (and include_once adds overhead).
Dan