<!DOCTYPE html>
<!--引入一个配置文件-->
{config_load file='config.conf'}
<html>
<head>
<meta charset="UTF-8">
<title>demo3</title>
</head>
<body>
<!--模板自定义函数-->
<!--assign函数用于给变量赋值 使用方法:-->
{assign var=name value=Lee}
assign函数:{$name}<br />
<!--counter用于输出一个计数过程-->
<!--属性 start从哪个位置开始计数
skip步长每次增加多少
direction判断递增还是递减 up为递增 down为递减
print 设置是否输出 false为不输出
assign 将结果按照变量来输出值为变量名
-->
counter函数:{counter start=5 skip=2} {counter} {counter} {counter}
{counter assign=c} {$c}<br />
<!--cycle用来交替轮换几组数据
如果再模板中使用多个轮转需要给出唯一的name属性
-->
cycle函数:
<p style="background: {cycle values='red,green'};">1</p>
<p style="background: {cycle values='red,green'};">1</p>
<p style="background: {cycle values='red,green'};">1</p>
<p style="background: {cycle values='red,green'};">1</p>
<!--debug查看模板的各项信息-->
<!--{debug}会弹窗-->
<!--eval可以显示普通变量和配置变量
assign将数据赋给变量
-->
eval函数:{eval var=$name}
{eval var=#webname#}
{eval var=#webname# assign=c}{$c}<br />
<!--html_image创建图片
alt 标签
href 超链接
border设置边框
-->
创建图片:{html_image file="http://www.baidu.com/images/logo.jpg"}<br />
<!--html_table显示表格 -->
表格:{html_table loop=$table}<br />
<!--math可以在模板中进行计算-->
{assign var=width value=10}
{assign var=height value=20}
长度计算相加:{math equation=$width+$height}<br />
<!--mailto电子邮件-->
{mailto address="390124971@qq.com" text="我的邮箱"}<br />
<!--textformat文字格式化-->
{textformat indent=200}
sasasa
{/textformat}
<!--fetch可以引入其它文件的源代码-->
<!--引入其它网页源代码{fetch file="new_file.html"}-->
</body>
</html>
运行效果