<?php
require_once('function.php');
$controllerAllow=array('test','index');
$methodAllow=array('test','index','show');
$controller =in_array($_GET['controller'],$controllerAllow)?daddslashes($_GET['controller']):'index';
$method =in_array($_GET['method'],$methodAllow)?daddslashes($_GET['method']):'index';
C($controller,$method);
?>
<?php
class testController{
function show(){
$testModel = M('test');
$data = $testModel->get();
$testView = V('test');
$testView->display($data);
}
}
?>
function.php文件中老师写过的“C('test','show');”注释掉就可以了,我也有过同样的问题。
应该是在哪里执行过一次show()方法了