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

setting section 'loop' value

 
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 -> 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:   
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 -> 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