码迷,mamicode.com
首页 > Web开发 > 详细

thinkphp-视图

时间:2017-04-14 20:23:57      阅读:140      评论:0      收藏:0      [点我收藏+]

标签:模板   use   user   html   xtend   content   this   isp   bsp   

 

 

 

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-视图

标签:模板   use   user   html   xtend   content   this   isp   bsp   

原文地址:http://www.cnblogs.com/yjh1604600160/p/think-7.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!