自动加载类的学习

Original 2019-06-24 10:21:48 175
abstract:    spl_autoload_register('auto1');    spl_autoload_register('auto2');    function auto1($className){    

    spl_autoload_register('auto1');

    spl_autoload_register('auto2');

    function auto1($className){

      $file = "./21".$className.".class.php";

      if(file_exists($file)){

        require "./21".$className.".class.php";

      }

    }

    function auto1($className){

      $file = "./22".$className.".class.php";

      if(file_exists($file)){

        require "./22".$className.".class.php";

      }

    }

自动加载类

Correcting teacher:天蓬老师Correction time:2019-06-24 10:36:49
Teacher's summary:这个自动加载器, 对于有命名空间的类, 并不适合, 想一下如何修改的更加通用些

Release Notes

Popular Entries