|
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 |
josuec Smarty n00b
Joined: 31 Jul 2008 Posts: 3
|
Posted: Thu Jul 31, 2008 8:36 pm Post subject: Loop Section com Resultado Incorreto |
|
|
Olá a todos.
Sou iniciante (noob) em smarty e estou com um problema com SECTION, segue o codigo:
{section name=ult loop=$ultimas}
<table width="249" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="278" height="35"><img src="img/marcador.jpg" width="10" height="8" /><a href="#" class="link-noticia">
{$ultimas.not_titulo[ult]}</a></td>
</tr>
<tr>
<td height="12"><img src="img/lay2 _r11_c9.jpg" width="249" height="4" /></td>
</tr>
</table>
{/section}
Pois bem, ao inves de me retornar 4 registro, que é o que tem na base de dados, me retornar 17 linhas.
alguém pode me ajudar a compreender isso? |
|
Back to top |
|
josuec Smarty n00b
Joined: 31 Jul 2008 Posts: 3
|
Posted: Thu Jul 31, 2008 9:36 pm Post subject: Achei o problema |
|
|
Bem, nem sem como descobrir, mais descobrir
O problema está na descricação do loop, exemplo:
Antes {section name=i loop=$ultimas}
Depois {section name=i loop=$ultimas.not_cod}
Como pode obeservar, foi colocado o nome do primeiro campo na especificação do loop.
Grato! |
|
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
|