There are three ways to do this:
First: direct use of return view (); Helper functions
The second kind: use think\view; Class Admin extends view see below
The Third Kind: use think\controller; Class Admin extends Controller return $this->>fetch ();
<?php
namespace App\admin\controller;
Use Think\view; The second Kind
Use Think\controller; Third Kind
Class Admin extends View
{
Public Function LST ()
{
The first method loads the template using the helper function to configure the template suffix in config is the simplest
return view ();
The second method loads the template, you need to specify the suffix format config invalid use Think\view extends View
$view =new View ([' view_suffix ' = ' htm ',]);
return $view->fetch ();
The third kind of use Think\controller; Configure the template suffix extends Controller in config
return $this->>fetch ();
}
}
ThinkPHP5 Introducing Templates