on-internet
← Community

Smarty: How can I pass on the incrementing {counter} value in the {include} function?

Stack Overflow ·

This smarty code loops (by calling upon itself with {include}) through a multidimensional array and puts the data per dimension into a multidimensional HTML list. I would like pass on an incrementing value. So how can pass on the {counter} value in the {include} function? <ul class="{$ulId}"> {foreach from=$tree item=wrapper} {assign var="idcat" value=$wrapper.idcat} {assign var="url" value=$wrapper.item->getLink()} {assign var="name" value=$wrapper.item->get('name')} {if $idcat|in_array:$path} {assign var="aClass" value='active'} {else} {assign var="aClass" value=''} {/if} <li> <a class="{$aC

Comments

Sign in or sign up to comment and upvote.

No comments yet.