直接在模板文件中运行php语句。
修改前面 http://blog.youkuaiyun.com/bq_cui/article/details/53395461 这篇的模板文件内容。
模板文件 /template/default/gycp/gycp_publish.htm:
<!--//说明: 显示公共头部模板-->
<!--{template common/header}-->
<br/>
<br/>
<br/>
<br/>
aaa
<br/>
<!--{eval $tmp_var = 'This is a string var in template.';}-->
<!--{eval echo $tmp_var;}-->
<br/>
<br/>
<br/>
<!--//说明: 显示公共尾部模板-->
<!--{template common/footer}-->
运行结果: