Created
July 1, 2017 22:25
-
-
Save antonioanerao/046759d4e4369e5f83c3285d8064ab7c to your computer and use it in GitHub Desktop.
simple autoload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
spl_autoload_register(function($nameClass) | |
{ | |
$dirName = "classes"; | |
$filename = $dirName . DIRECTORY_SEPARATOR . $nameClass . ".class.php"; | |
if(file_exists($filename)) | |
{ | |
require_once($filename); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment