卡在這里了core\route' not found
$route = new \core\route(); 這行你們報(bào)錯(cuò)嗎?我的為什么一直報(bào)錯(cuò):Fatal error: Class 'core\route' not found in /vagrant/spl/core/imooc.php on line 9;
$route = new \core\route(); 這行你們報(bào)錯(cuò)嗎?我的為什么一直報(bào)錯(cuò):Fatal error: Class 'core\route' not found in /vagrant/spl/core/imooc.php on line 9;
2016-08-26
舉報(bào)
2016-09-02
把route文件放在 core目錄下就不會(huì)報(bào)錯(cuò)了
2017-11-19
我的也沒有解決,route.php是在core下,new \core\route()也不行,求大佬解救
2017-11-10
我的還出錯(cuò)
2016-09-02
看了一下 他寫的是在core目錄下的,之前沒看清,不過我上面說的方法是可以解決的
2016-09-02
他這里的文件目錄有問題 你要是想按照他的代碼 就把route拿到core目錄下。如果你要把route放在common下 在route下的namespace 設(shè)為 core\common 然后在imooc文件出寫$route = new \core\common\route();就OK 了
2016-08-28
應(yīng)該是Load()函數(shù)中加載文件路徑的問題,按視頻中的寫路徑總是不對(duì),我做了下改動(dòng),去掉路徑前的APP常量,就沒報(bào)錯(cuò)了,具體如下:
?static public function load($class){
? ? ? ?if(isset(self::$classMap[$class])){?
? ? ? ? ? ?return true;
? ? ? ?}else{ ? ? ? ??
? ? ? ? ? ?$class=str_replace('\\', '/', $class); ? ? ? ? ?
? ? ? ? ? ?$file=$class.'.php';
? ? ? ? ? ?if(is_file($file)){ ? ? ? ? ?
? ? ? ? ? ? ?include $file;
? ? ? ? ? ? ?self::$classMap[$class]=$class; ? ? ? ??
? ? ? ? ? ?}else{
? ? ? ? ? ? ? ?return false;
? ? ? ? ? ?}
? ? ? ?}
? ? }