Re: [SMARTY] Int incr/decr on the fly
| From: | Luc Saint-Elie | Date: | Fri, 16 Jan 2004 15:49:26 +0000 |
| Subject: | Re: [SMARTY] Int incr/decr on the fly | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-10829@lists.php.net to get a copy of this message | ||
Le 16 janv. 04, à 16:27, Luca Borrione a écrit :
Hi all, assuming I use a generic tag: {tag var="$myvar"} assuming $myvar is an integer, I would like only to increment or decrement its value by 1 without previously use a math tag. {tag var="$myvar++"} How is it the correct syntax for it?Hello I don't know if this is the correct solution (this is probably NOT the corerect qsolution) but I had the same problem for a protfolio display each image having to links one to the previous and one to the next. The variable $portfolio.id is the id of current image I use this (OK please don't laught you smarty gurus, this looks ugly but this works :-) ) <a href="{$smarty.server.PHP_SELF}?page=image&p={math equation="x - y" x=$portfolio.id y=1}"> <img src="images/flecheprevious.gif" alt="" name="imgprev" id="imgprev" width="20" height="20" border="0"> </a> And this <a href="{$smarty.server.PHP_SELF}?page=image&p={math equation="x + y" x=$portfolio.id y=1}"> <img src="images/flechenext.gif" alt="" name="imgnext" id="imgnext" width="20" height="20" border="0"> </a> Luc