Created
October 17, 2012 19:34
-
-
Save dflima/3907621 to your computer and use it in GitHub Desktop.
Simple autoload function in 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 | |
define('RAIZ_DA_APP', dirname(__FILE__)); | |
define('LIB', RAIZ_DA_APP.'/lib'); | |
function meuAutoload($classe){ | |
$d = LIB; | |
include "{$d}/{$classe}.php"; | |
} | |
spl_autoload_register('meuAutoload'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment