出现报错 Fatal error: Class 'core\route' not found in E:\phpStudy\WWW\imooc\core\imooc.php on line 18
public static $classMap = array();
static public function run()
{
$route = new \core\route(); //18行
}
static public function load($class)
{
//自动加载类库
if (isset($classMap[$class])) {
return true;
} else {
$class = str_replace('\\', '/', $class);
$file = IMOOC . '/' . $class . ' php';
p($file);
if (is_file($file)) {
include $file;
self::$classMap[$class] = $class;
} else {
return false;
}
}
}