赣南脐橙

佰草伐

导航

thinkphp 前台输出

<?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();
    }
}

  php知识网

posted on 2020-09-10 16:01  佰草伐  阅读(197)  评论(0编辑  收藏  举报

自定义导航网站

php基础知识

Wood Furniture