Nagri
Nagri

Reputation: 3156

Trouble with Smarty Template Engine

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]} ?

Upvotes: 0

Views: 110

Answers (1)

Sibu
Sibu

Reputation: 4617

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

Upvotes: 2

Related Questions