assign与fetch方法
$this->assign('title','learn php');
$this->fetch('index');
// 或者
$title='learn php';
$this->assgin('title',$title);
$this->fetch('index');
$this->assign([
'auther'=>'brell',
'title'=>'how to learn php'
]);
$this->fetch('index');
fetch传值及显示
return $this->fetch('index',[
'author'=>'brell',
'title'=>'how to learn php'
]);
循环
{volist name="list" id="data"}
循环体
{/volist}
{foreach name="list" iteam="data"}
循环体
{/forearch}
字符串截取
{$article|substr=0,10}
公用模板
{include file='public:header'}
这表默认路径是指向当前模块下view目录下的public目录下的header.html文件