Re: [SMARTY] Int incr/decr on the fly
| From: | Luca Borrione | Date: | Mon, 19 Jan 2004 13:35:46 +0000 |
| Subject: | Re: [SMARTY] Int incr/decr on the fly | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-10851@lists.php.net to get a copy of this message | ||
Mark Gibson ha scritto:
[cut]
see the docs at: http://smarty.php.net/manual/en/language.math.phpHi Mark, this is exactly what I needed. The answer was in the manual, but I missed it. Thank for your help. Cheers, Luca PS:
{tag var=$myvar++} Does the trick.I know I can avoid this using $myvar+1 as described in the previous link, but, only because I'm used to this, it would be nice to use this syntax. Unluckly I cannot.. that's my experience with 2.6.0
{assign var="foo" value=1}
{assign var="test" value=$foo++}
or
{assign var="test" value="$foo++"}
or
{assign var="test" value=$foo++}
{$test}
OUTPUT: 1
{assign var="foo" value=1}
{assign var="test" value="$foo++"}
OUTPUT: 1++
I cannot output 2!
So, what d'you mean with *does the trick*?