|
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 |
TomGrill Smarty Rookie
Joined: 22 May 2003 Posts: 5
|
Posted: Fri May 23, 2003 12:24 pm Post subject: $i++ what to do ? |
|
|
hi,
how can i count a $var up ?
sample:
{foreach....}
$var++ or {$var++}
{/foreach}
can i do this with smarty ?? and how ?? |
|
Back to top |
|
sweatje Smarty Regular
Joined: 17 Apr 2003 Posts: 70 Location: Bettendorf, Iowa, USA
|
Posted: Fri May 23, 2003 12:34 pm Post subject: |
|
|
Code: | {section name=i loop=10}
i={$smarty.section.i.rownum}<br />
{/section} |
_________________ Jason
jsweat_php AT yahoo DOT com |
|
Back to top |
|
TomGrill Smarty Rookie
Joined: 22 May 2003 Posts: 5
|
Posted: Fri May 23, 2003 1:03 pm Post subject: |
|
|
and in a foreach ? |
|
Back to top |
|
sweatje Smarty Regular
Joined: 17 Apr 2003 Posts: 70 Location: Bettendorf, Iowa, USA
|
Posted: Fri May 23, 2003 1:13 pm Post subject: |
|
|
Not tested:
see this thread
before foreach
Code: | {assign var=var value=1} |
in foreach
Code: | {assign var=var value=$var|pp} | should work _________________ Jason
jsweat_php AT yahoo DOT com |
|
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
|