Skip to content

Instantly share code, notes, and snippets.

@DennisRas
Created November 5, 2011 20:44
Show Gist options
  • Save DennisRas/1341991 to your computer and use it in GitHub Desktop.
Save DennisRas/1341991 to your computer and use it in GitHub Desktop.
Autoloader for CodeIgniter
function __autoload($class)
{
if (strpos($class, 'CI_') !== 0)
{
if (file_exists($file = APPPATH . 'core/' . $class . EXT))
{
include $file;
}
elseif (file_exists($file = APPPATH . 'libraries/' . $class . EXT))
{
include $file;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment