|
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 |
Chraensch Smarty Rookie
Joined: 10 Sep 2003 Posts: 6
|
Posted: Wed Sep 10, 2003 11:04 am Post subject: Increase Var in {section} |
|
|
Hey all.
Maybe I'm just an Idiot, but I can't find a solution to this problem:
I'm trying, in a {section} loop, to increase a var but I keep failing, can anyone help me? here's the thingy:
Code: | {assign var="rep_var" value=0}
{section name=subl loop=$headers}
{if $headers[subl]->parent == $headers[lp]->messageid}
{assign var="rep_var" value=+1} {* this is were I want to increase, I tried different methods but kept failing *}
{/if}
{/section}
{$rep_var} |
|
|
Back to top |
|
andre Smarty Pro
Joined: 23 Apr 2003 Posts: 164 Location: Karlsruhe, Germany
|
Posted: Wed Sep 10, 2003 11:09 am Post subject: |
|
|
In current CVS version you can use
{assign var="rep_var" value=$rep_var+1}
Otherwise you need to use the math function
{math assign="rep_var" equation="x+1" x=$rep_var} |
|
Back to top |
|
Chraensch Smarty Rookie
Joined: 10 Sep 2003 Posts: 6
|
Posted: Wed Sep 10, 2003 11:26 am Post subject: |
|
|
thank you, It works now. Used the math function as I'm not using the current CVS Version. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
|
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
|