我正在尝试使用 Fat Free 中的命名空间。一切正常,但是当我添加命名空间时,我得到了这个:
内部服务器错误
Fatal error: Class 'Gadgets\iPad' not found
这是我的代码:
索引.php
$f3=require('lib/base.php');
$f3->set('AUTOLOAD','ui/');
$f3->route('GET /', function(){
$obj=new Gadgets\iPad;
echo $obj->hallo('cat');
});
$f3->run();
用户界面/iPad.php
namespace Gadgets;
class iPad {
function hallo($word){ echo $word;}}
谢谢