我想在Smarty中显示以下数组:
->value = Array (2)
0 => Array (1)
0 => Array (4)
SiteName => "USA"
SanctionID => "41470"
Program => "Men"
Amount => "5.00"
1 => Array (1)
0 => Array (4)
SiteName => "USA"
SanctionID => "41471"
Program => "Men"
Amount => "5.00"
我正在使用两个foreach循环,但无法显示值。感谢任何帮助。
{foreach from=$SXid item=Amount key=SiteName}
{foreach from=$SXid[sxid] item=Amount key=SiteName}
<tr>
<td></td>
<td>{$Amount} is {$SiteName}</td>
<td></td>
</tr>
{/foreach}
{/foreach}
答案 0 :(得分:1)
试
{foreach from=$SXid item="outer" key="outer"}
{foreach from=$outer item="value" key="key"}
<tr>
<td></td>
<td>{$key|escape} => {$value|escape}</td>
<td></td>
</tr>
{/foreach}
{/foreach}