我在瀏覽器中會顯示hello worldhello world。請問這是怎么回事?
<?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);
}
}
?>
2015-07-16
function.php文件中老師寫過的“C('test','show');”注釋掉就可以了,我也有過同樣的問題。
2015-06-19
應該是在哪里執行過一次show()方法了