I am Having Trouble with Smarty.
I need to do some calculations, Assignments, and Deletions in the .tpl
file i.e. smarty.
But the problem I am facing is that when ever I do {$idlist[$iSum+1]}
It gives Error. here $idlist is an array and $iSum
is a an Integer.
It works fine with {$idlist[$iSum]}
or {$idlist[3]}
but gives error in {$idlist[$iSum+1]}
What must be the syntax to run some statement like this {$idlist[$iSum+1]}
?
Asked
Active
Viewed 100 times
0

Nagri
- 3,008
- 5
- 34
- 63
-
did u try `{$idlist[($iSum)+1]}` – Bhuvan Rikka Sep 22 '12 at 10:21
-
@BhuvanRikka That Doesn't Work – Nagri Sep 22 '12 at 11:08
1 Answers
2
Try it this way
{assign var="iSum" value=$iSum+1}
since you also want to use mathematical operation template side, Also read smarty math function

Sibu
- 4,609
- 2
- 26
- 38