Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Duda con Smarty y Foreach

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Spanish
View previous topic :: View next topic  
Author Message
quimera
Smarty n00b


Joined: 21 Feb 2008
Posts: 2

PostPosted: Thu Feb 21, 2008 9:07 pm    Post subject: Duda con Smarty y Foreach Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Spanish All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP