Skip to content

Instantly share code, notes, and snippets.

Last active Apr 1, 2016
What would you like to do?
defined('BASEPATH') OR exit('No direct script access allowed');
class CI_Classes
private $_include_paths = array();
public function register(array $paths = array())
$this->_include_paths = $paths;
spl_autoload_register(array($this, "autoloader"));
public function autoloader($class)
foreach ($this->_include_paths as $path) {
$filepath = $path . $class . ".php";
if(!class_exists($class, FALSE) AND is_file($filepath)) {
include_once ($filepath);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment