修改基类

This commit is contained in:
cxdbz committed 2019-12-04 20:12:43 +08:00
1 parent 6fc9c6861d
commit bbaa12e65f
2 files changed
+11 -10

No files matched your search

+8 -10
View File
@@ -5,8 +5,6 @@ namespace app\index\controller;
use app\BaseController;
// 引用与此控制器同名的数据模型
use app\system\model\SystemBase as sysbasemod;
// 引用视图类
use think\facade\View;
class Index extends BaseController
@@ -15,10 +13,11 @@ class Index extends BaseController
// 初始化
protected function initialize()
{
}
// 主页
public function index()
{
@@ -80,13 +79,12 @@ class Index extends BaseController
])
->order(['paixu'])
->select()->toArray();
// return view('list', $list);
$view = app('view');
// 模版赋值
View::assign('list',$list);
$view->assign('list',$list);
// 渲染输出
return View::fetch();
return $view->fetch();
}
@@ -137,13 +135,13 @@ class Index extends BaseController
$view = app('view');
// 模版赋值
View::assign('list',$list);
$view->assign('list',$list);
// 渲染输出
return View::fetch('welcome');
return $view->fetch('welcome');
}