<?php
name app\index\model;
use think\Model;
class TypeModel extends Model{
public function getdata(){
return '测试模型';
}
}
?>
控制器:
<?php
namespace app\index\controller;
use app\index\model\Type;
class Index extends \think\Controller
{
public function index()
{
$model = new Type;
echo $model->getdata();
}
}
结果:
页面错误!请稍后再试~
最佳答案