I'm trying to load a class that is in another folder in the core.php file and I'm not getting
My browser reports this message
Fatal error: Uncaught Error: Class 'Core' not found in /var/www/html/cursophp/superAdvanced/mvc/views/index.php:18 Stack trace: # 0 {main} thrown in /var/www/html/cursophp/superAdvanced/mvc/views/index.php on line 18
Below is the content of the index.php file
spl_autoload_register(function($class){
if (strpos($class, 'Controller') > -1) {
if (file_exists('controllers/'.$class.'.php')){
require_once 'controllers/'.$class.'.php';
}else if(file_exits('models/'.$class.'.php')){
require_once 'models/'.$class.'.php';
}else {
require_once 'core/'.$class.'.php';
}
}
});
$core = new Core();
Below is the core.php file
<?php
class Core {
}
?>