foreach 在模板时简单使用使用方法为:
<{foreach name=test from=$test item=item key=key}>
<{$item.name}>
<{/foreach}>
其在$smarty内部有几个值可供使用.
$smarty.foreach.test.name 名称
$smarty.foreach.test.total 迭代总数
$smarty.foreach.test.iteration 当前迭代index
<{foreach name=test from=$test item=item key=key}>
<{$item.name}>
<{/foreach}>
其在$smarty内部有几个值可供使用.
$smarty.foreach.test.name 名称
$smarty.foreach.test.total 迭代总数
$smarty.foreach.test.iteration 当前迭代index