【发布时间】:2010-08-05 11:03:36
【问题描述】:
我有一个简单的问题。我需要将 1,2,3 等附加到 smarty 中的变量名。变量是$user1、$user2、$user3 等。我使用 smarty 来做一个这样的简单循环:
{section name=user_info start=1 loop=$users}
<tr>
<td> User{$smarty.section.user_info.index} </td> // prints user1, user2, user3 etc
<td>
{$user} append this: {$smarty.section.user_info.index} // need to call $userX
</td>
</tr>
{/section}
我在variable info site to smarty 上尝试了所有方法。
【问题讨论】:
标签: php variables loops smarty append