Tag: loop counter

How to access loop counters in Smarty

Sometimes Smarty’s syntax is not quite self-explanatory. Recently I was asked how loop counters can be implemented for foreach-loops. According to the API docs there’s an @iteration directive for this case, such that the following should work: Unfortunately, the value remained 0 regardless of the current loop iteration. Another (working) approach is to specify a […]