{* section函数的基本使用方法*}
函数体:
{section name=customer loop=$custid}
id: {$custid[customer]}<br>
{/section}
//customer为该section的名称,$custid为section要循环的数组
//section的第一种写法:$custid[customer],即所循环的数组[section名称].所循环数组的参数。
输出:
id: 1000<br>
id: 1001<br>
id: 1002<br>
*****************************************************
第二个例子:
{section name=customer loop=$custid}
id: {$custid[customer]}<br>
name: {$name[customer]}<br>
address: {$address[customer]}<br>
<p>
{/section}
这个例子是为了引出section的第二种用法:$name[customer],$name为$custid的参数(或者称为键)
函数体:
{section name=customer loop=$custid}
id: {$custid[customer]}<br>
{/section}
//customer为该section的名称,$custid为section要循环的数组
//section的第一种写法:$custid[customer],即所循环的数组[section名称].所循环数组的参数。
输出:
id: 1000<br>
id: 1001<br>
id: 1002<br>
*****************************************************
第二个例子:
{section name=customer loop=$custid}
id: {$custid[customer]}<br>
name: {$name[customer]}<br>
address: {$address[customer]}<br>
<p>
{/section}
这个例子是为了引出section的第二种用法:$name[customer],$name为$custid的参数(或者称为键)