1
About autoload I studied about:
Autoload for classes in the same folder
function __autoload($nomeClass) {
require_once ("$nomeClass.php");
}
Autoload for classes in specific folders
spl_autoload_register(function ($nomeClass) {
if (file_exists("Classes".DIRECTORY_SEPARATOR.$nomeClass.".php") === true) {
require_once ("Classes".DIRECTORY_SEPARATOR.$nomeClass.".php");
}
});
How would I make autoload work not just inside the "classes" folder but load any class called in any part of the project, how to do this?