Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Dedicated server web hosting provided by Guru-host.eu.
setting section 'loop' value

 
Post new topic   Reply to topic    Smarty Forum Index -> Tips and Tricks
View previous topic :: View next topic  
Author Message
joenuts
Smarty n00b


Joined: 07 Jan 2005
Posts: 1

PostPosted: Fri Jan 07, 2005 3:36 pm    Post subject: setting section 'loop' value Reply with quote

I would like to set the section loop value to be the length of the array, plus one. The only way so far I have found to accomplish this is like so :

{assign var=Length value=$pFieldList|@count}
{section name=BlankRowLoop start=0 loop=$Length+1}
<td class="DataEditCell"><insert html space here>
{/section}

I have tried variations on the loop, like loop=$pFieldList+1, loop=$pFieldList++, loop=`$pFieldList|@count`+1, all without succes.
I'm guessing there is a way to do it easily, with either foreach, or section, but can not find it / figure it out.

Suggestions are appreciated.
Thanks
-Joe
Back to top
View user's profile Send private message
kilburn
Smarty Rookie


Joined: 08 Oct 2004
Posts: 21

PostPosted: Mon Jan 10, 2005 7:00 pm    Post subject: Reply with quote

Maybe....
Code:
{section name=l loop=$pFieldList}
<td class="DataEditCell"> </td>
{/section}
<td class="DataEditCell"> </td>
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Tips and Tricks 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