Controller
<?php
class testController{
//控制器的作用是调用模型并调用视图,将模型产生的数据传递给视图,并让相关视图去显示
function show(){
/* $testModel = new testModel();
$data = $testModel->get();
$testView = new testView();
$testView->display($data);*/
$testModel = M('test');
$data = $testModel->get();
$testView = V('test');
$testView->display($data);
}
}
?>
Model
<?php
class testModel{
function get(){
return "hello world";
}
}
?>
view
<?php
class testView{
function display($data){
echo $data;
}
}
?>
function