Last active
April 23, 2019 09:34
-
-
Save nicoxxxcox/7c0bb22a5b827a86ae267b1fb6b8a3f2 to your computer and use it in GitHub Desktop.
Autoloader verry simple - PHP
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 | |
class Autoloader | |
{ | |
static function register() | |
{ | |
spl_autoload_register(array(__CLASS__, 'autoload')); | |
} | |
static function autoload($class_name) | |
{ | |
require 'class/' . $class_name . '.class.php'; | |
} | |
} |
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 | |
require './class/Autoloader.class.php'; | |
Autoloader::register; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment