<?php
namespace app\index\controller;
use think\Controller;
use think\facade\View;
class Demo7 extends Controller
{
public function test1()
{
$content="<h3>nishi</h3>";
//return $this->view->display($content);
return View::display($content);
}
public function test2()
{
$this->view->assign('title', '98');
$obj = new \stdClass();
$obj->name="PHP";
$this->view->assign('obj',$obj);
return $this->view->fetch();
}
public function test3()
{
$data = \app\model\Daohang::all();
$this->view->assign('data',$data);
return $this->view->fetch();
}
public function test4()
{
$data = \app\model\Daohang::paginate(3);
$this->view->assign('data',$data);
return $this->view->fetch();
}
}
https://www.cnblogs.com/furuihua/p/13646263.html