Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Autoloading in PHP5 with namespaces
// be sure to name the project dir with the name of the namespace;
function AutoLoader($className)
$file = str_replace('\\','/',$className);
require_once $_SERVER["DOCUMENT_ROOT"]."/".$file.'.class.php';
//Make your own path, Might need to use Magics like ___DIR___
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.