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

Pasar de PHP a plantilla Smarty

 
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
piropeator
Smarty Rookie


Joined: 31 Oct 2007
Posts: 26

PostPosted: Fri Oct 08, 2010 11:13 pm    Post subject: Pasar de PHP a plantilla Smarty Reply with quote

En internet encontré este código que es para alternar colores en las filas de un listado, está en PHP:
Code:
echo "<table width='100%'>";

while($array = mysql_fetch_array($cad)) {

   if ($colorfila==0){
       $color= "#DEDEBE";
       $colorfila=1;
    }else{
       $color="#F0F0F0";
       $colorfila=0;
    }

    echo "<tr><td bgcolor='".$color."'><font face='Arial' size='2'>".$array['titulo']."</font></td></tr>";

}
echo "</table>";

Quiero transformar el codigo para utilizarlo en una plantilla TPL de smarty, ya logré incluir el while utilizando {section y loop}, pero la parte del IF, el displayado y el $color no funcionan, incluso utilizando {php}...{/php}
Cómo logro esto?
El codigo lo encontré aquí: http://www.webexperto.com/articulos/art/143/alternar-el-color-de-filas-en-paginacion/
Gracias.
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