Fatal error: require() [function.require]: Failed opening required '../Controllers/testController.php' (include_path='.;C:\php\pear') in F:\MyProgram\php\Hello\test.php on line 11
2017-06-22
Warning: require(../Controllers/testController.php) [function.require]: failed to open stream: No such file or directory in F:\MyProgram\php\Hello\test.php on line 11
2017-06-22
入口文件应该先检测一下是否有$_GET的值吧,
$controller = isset($_GET['controller'])?in_array($_GET['controller'],$controllerAllow)?$_GET['controller']:'test':'test';
$method = isset($_GET['method'])?in_array($_GET['method'],$methodAllow)?$_GET['method']:'show':'show';
$controller = isset($_GET['controller'])?in_array($_GET['controller'],$controllerAllow)?$_GET['controller']:'test':'test';
$method = isset($_GET['method'])?in_array($_GET['method'],$methodAllow)?$_GET['method']:'show':'show';
2017-06-15
eval不是要尽量少用吗,可以直接 $obj = new $classname; $obj->$methodname();
2017-06-15
直接创建一个工厂类专门来实例化对象就可以了啊,当用到具体的操作时,直接用实例化的对象调用自己的方法来实现。何必在工厂里面写这么多静态方法呢,静态成员声明得过多,内存会一直被占用,对于大型框架来说会很影响系统的性能吧。。。 个见,希望交流指正!
2017-06-14