Php smarty中的每次迭代?
如何使用smarty在foreach循环的一次迭代中获得两条记录?Php smarty中的每次迭代?,php,smarty,Php,Smarty,如何使用smarty在foreach循环的一次迭代中获得两条记录? 或者我应该使用直接从上的文档中获取的部分?。请务必阅读文档 {* $rows[row.index] and $rows[row] are identical in meaning *} <table> <tr> <th>index</th><th>id</th> <th>index_prev</th><th&
或者我应该使用直接从上的文档中获取的部分?。请务必阅读文档
{* $rows[row.index] and $rows[row] are identical in meaning *}
<table>
<tr>
<th>index</th><th>id</th>
<th>index_prev</th><th>prev_id</th>
<th>index_next</th><th>next_id</th>
</tr>
{section name=row loop=$rows}
<tr>
<td>{$smarty.section.row.index}</td><td>{$rows[row]}</td>
<td>{$smarty.section.row.index_prev}</td><td>{$rows[row.index_prev]}</td>
<td>{$smarty.section.row.index_next}</td><td>{$rows[row.index_next]}</td>
</tr>
{/section}
</table>
两张唱片到底是什么意思?你能提供更多的细节吗?
index id index_prev prev_id index_next next_id
0 1001 -1 1 1002
1 1002 0 1001 2 1003
2 1003 1 1002 3 1004
3 1004 2 1003 4 1005
4 1005 3 1004 5