|
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 |
quimera Smarty n00b
Joined: 21 Feb 2008 Posts: 2
|
Posted: Thu Feb 21, 2008 9:07 pm Post subject: Duda con Smarty y Foreach |
|
|
Hola! queria consultarles sobre un loop que estoy haciendo y no puedo resolver.
Esto usando FOREACH. Hago un select de una tabla y quiero mostrar el resultado
Lo que logre hacer sin problemas es que por cada registro de la tabla me muestre una row y sus columnas. Lo que quiero hacer ahora es que dato un registro de la tabla (previo fetch) me muestre cada campo de la tabla como fila y no lo peudo lograr.
Les adjunto el codigo que si me anda, que por cada campo de la tabla hace una columna y por cada fetch una fila
Espero que me pueda ayudar
{foreach name=outer item=DatoLista from=$DatosLista}
<tr bgcolor=#ffffff valign=top>
{foreach key=key item=item from=$DatoLista}
<td>
{if $key eq 0}
{if !$item}
N/A
{else}
<IMG src={$item} width=50 height=50 align=left border=1>
{/if}
{else}
{$item}
{/if}
</td>
{/foreach}
</tr>
{/foreach}
Damian |
|
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
|