摘要:        
我们按照文件目录的结构来为每个类写入命名空间,当在一个类中需要实例化另外一个类时,IDE会帮我们写入use namespace;  。这样,我们在写自动加载的时候,就不用考虑将要加载的类在哪一个文件目录下了,只需要这样写:
spl_autoload_register(function ($class) {
    require $class . '.php';
});    阅读全文
posted @ 2017-07-08 19:43
zhaoxingya
阅读(3908)
评论(0)
推荐(1)
        

浙公网安备 33010602011771号