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