时间:2021-07-01 10:21:17 帮助过:19人阅读
thinkPHP中有一个方法和display()相似,fetch();
$this->display();展示模板
$this->fetch()获取模板(有返回值)
TP中有一个友好的打印方法dump(要打印的变量)
<?php
namespace Admin\Controller;
use Think\Controller;
class PublicController extends Controller{
public function login(){
//展示模板
//$this->display();
//获取模板内容
$str=$this->fetch();
dump($str);
// echo $str;//和display()一样
}
}相关文章推荐:
thinkphp框架分组:thinkphp获取满足条件的数据
Ubuntu系统下如何来隐藏TP的入口文件
以上就是thinkPHP框架中视图的讲解(附代码)的详细内容,更多请关注Gxl网其它相关文章!