Created
July 1, 2019 08:48
-
-
Save belocer/bc09f922ebafe5da0c1b6f498f386b87 to your computer and use it in GitHub Desktop.
AutoLoad Classes
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 ($ClassName){ | |
$filePath = 'classes/' . $ClassName; | |
if (file_exists($filePath)) { | |
require_once $filePath; | |
} | |
}); | |
spl_autoload_register(function ($ClassName){ | |
$filePath = 'controller/' . $ClassName; | |
if (file_exists($filePath)) { | |
require_once $filePath; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment