문제

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

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top