首页 > 代码库 > thinkphp-视图

thinkphp-视图

 

 

 

class UserController extends Controller {
  public function shitu(){
    $this->assign(‘name‘,‘白小飞‘);

             <body>

    //html文件中:  我叫:{$name}

             </body>

 


    //$this->display();
    //默认输出模板文件
    //User/shitu.html

    /* //修改模板文件
    //$this->display(‘add‘);
    //Home/View/User/add.html

    //$this->display(‘Asd/add‘);
    //Home/View/Asd/add.html

    //$this->theme(‘Asd‘)->display();
    //Home/View/Asd/User/shitu.html

    //$this->display(‘Model@Asd/add‘);
    //Model/View/Asd/add.html

    //$this->display(‘./Asd/Asd/Asd/asd.html‘);
    //./baidu/Home/View/./Asd/Asd/Asd/asd.html.html
    //但前面那部分和后面那部分可以忽略,也就是Asd/Asd/Asd/asd.html
    //自定义模板文件
    */

    //echo T();
    //打印出此
    //echo T(‘Asd/add‘);
    //打印修改
    //$this->display(T(‘User/add‘));
    //
    $content=$this->fetch();
    $this->show($content);
    //fetch()获取内容,show()方法输出



  }

}

thinkphp-视图