|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
janmartin Smarty Rookie
Joined: 28 Mar 2004 Posts: 7 Location: nearby London, UK
|
Posted: Tue Mar 30, 2004 11:55 am Post subject: dynamic table with header: Variable for first column data? |
|
|
Hi,
I am using the dynamic tables code mentioned at
http://www.phpinsider.com/smarty-forum/viewtopic.php?p=6047#6047
Given, that the data is like:
id, first_name, last_name, username, tel_number, fax_number
etc.
This will be displayed automatically, including the header names.
But how to reference the id, that has been dispalyed in the first column of the current row, to reuse it as edit link in the last row:
<a href="user_edit.php?user={MISSINGCODE}">Edit</a>
{$test[myrow][id]} does not work. Whats the right code?
Any help is welcome.
JanMartin
[/code]<table>
This is the whole table code:
<tr>
{section name=col loop=$headers} {* START HEADER ROW *}
<th>{$headers[col]}</th>
{/section}
{if $smarty.section.mycolumn.last} {* END HEADER ROW *}
</tr>
{section name=myrow loop=$test} {* START DATA ROW *}
<tr>
{section name=mycolumn loop=$test[myrow]} {* START DATA COLUMN *}
<td>
{if $smarty.section.mycolumn.last}
<a href="user_edit.php?user={MISSINGCODE}">Edit</a>
{else}
{$test[myrow][mycolumn]}
{/if}
</td>
{/section}{* END DATA COLUMN *}
</tr>
{/section} {* END DATA ROW *}
</table>[/code] |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|