Base d'un site web v2

This commit is contained in:
Sanchez
2017-04-17 23:05:15 +02:00
committed by mathieu
parent e761ff7c5a
commit ec9eb79038
21 changed files with 143 additions and 103 deletions

View File

@ -7,7 +7,7 @@ class Autoloader {
/**
* Enregistre notre autoloader
*/
static function register(){
static function register() {
spl_autoload_register(array(__CLASS__, 'autoload'));
}
@ -15,7 +15,7 @@ class Autoloader {
* Inclue le fichier correspondant à notre classe
* @param $class string Le nom de la classe à charger
*/
static function autoload($class){
static function autoload($class) {
if (preg_match('#^' . Config::NAMESPACE . '\\\(.+)$#', $class, $matches))
require 'src/' . str_replace('\\', '/', $matches[1]) . '.php';
}