I\'m actually trying to create a MVC framework for my own, however I\'m having troubles with the Autoload. It\'s not a problem actually, but I\'d like to ask the gurus, how are
The code below will help. But I'll advice you check on Namespaces.
spl_autoload_register ( function ($class) { $sources = array("Controllers/$class.php", "Lib/$class.php ", "Models/$class.php " ); foreach ($sources as $source) { if (file_exists($source)) { require_once $source; } } });