You are here: Re: [SMARTY] Smarty, PEAR, Associative Array and Loops « Smarty Templates Posts « IT news, forums, messages
Re: [SMARTY] Smarty, PEAR, Associative Array and Loops

Posted by Panu on 04/06/05 15:56

Reynier Pérez Mira wrote:
> Can you explain a little more?? I not understand. I'm
> new in the world of Smarty.

instead of:

while($row = $evenres->fetchRow()){
array_push($titulo,$row[1]);
array_push($descripcion,$row[2]);
array_push($contenido,$row[3]);
$template->assign("titArr",$titulo);
$template->assign("descArr",$contenido);
$template->assign("conArr",$descripcion);
}

use:

while($row = $evenres->fetchRow()){
array_push($titulo,$row[1]);
array_push($descripcion,$row[2]);
array_push($contenido,$row[3]);
}

$template->assign("titArr",$titulo);
$template->assign("descArr",$contenido);
$template->assign("conArr",$descripcion);

addionally the name attribute in the section is the index so:

instead of

{section name=titulo loop=$titArr}
<tr>
<td width="3%" valign="top" class="tddoted"
align="center"><strong>{$smarty.section.eventos.rownum}.</strong></td>
<td width="97%" class="padding-td
tddoted">{$evenArr[eventos]}</td>

use:

{section name=titulo loop=$titArr}
<tr>
<td width="3%" valign="top" class="tddoted"
align="center"><strong>{$smarty.section.titulo.index}.</strong></td>
<td width="97%" class="padding-td tddoted">{$evenArr[titulo]}</td>

--
http://www.xs4all.nl/~hanb/documents/quotingguide.html

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация