1
如果我使用的命名空间,例如我有以下的目录树在PHP的命名空间,我需要要求每个文件
Test/someclass.php
Test/someotherclass.php
可我根本就
use \Test\someotherclass
或者我需要先做
require 'Test/someotherclass.php'
,然后我可以实际使用的该类 因为目前当我这样做,我得到的第Ë以下错误
Fatal error: Class 'Test\someOtherClass' not found in C:\xampp\htdocs\test\Test\someClass.php on line 10
命名空间==自动加载器.....使用自动加载器包含需要的类文件 –
我该怎么做? – elibyy
[PHP DOC](http://us3.php.net/manual/fr/function.spl-autoload-register.php)看看这个 – bastienbot