Thinkphp5页面加载的三种方式

Thinkphp5页面加载的三种方式:

        方式一、系统函数

                      public function index(){

                            return view();

                        }

方式二、系统view类

                     public function index(){

            $view=new View();

            return $view->fetch();

                        }

3、通过Controller

// 需要控制器继承系统类

                    use  think\Controller;

                    class Index extends Controller

                    public function index(){

            return $this->fetch();

                    }

猜你喜欢

转载自blog.csdn.net/shaoyanlun/article/details/80522718