php模板引擎smarty内置 条件 循环 函数

php模板引擎smarty内置函数<br /> 1,foreach数组的处理<br /> 2,include多功能使用<br /> 3,if条件<br /> 4,literal strip<br /> <br /> 1<br /> {foreach from:$name item=id}<br /> id:{id}&lt;br&gt;<br /> {/foreach}<br /> <br /> {foreach key=j item=v from=$name}<br /> {$j}:{$v}&lt;br&gt;<br /> {/foreach}<br /> <br /> 2<br /> {include file=&quot;head.htm&quot;}<br /> {include file=&quot;d:\gaga\dd.htm&quot;}<br /> {include file=&quot;head.html&quot; title=&quot;title&quot;}<br /> <br /> 3,if条件语句的使用<br /> {if $name==&quot;ok&quot;}<br /> {else}<br /> {/if}<br /> <br /> 4,{literal}<br /> {literal}<br /> &lt;script&gt;<br /> function gaga(){<br /> <br /> }&lt;/script&gt;<br /> <br /> {strip}<br /> <br /> {strip}
RangeTime:0.006968s
RangeMem:204.42 KB
返回顶部 留言