Smarty Nested foreach loop question
问题 I am having trouble getting the below array to display properly in a smarty template file. If anyone can help point me in the right direction I would be most thankful. my template code looks like this: {foreach from=$trackingGroups item=gender key=k item=v} {assign var=tc value="`$v.id`"} {$v.title} ({$v.productCount})<br /> {foreach item=department from=$trackingGroups.$tc item=v2} {$v2.title} {/foreach} {/foreach} but the page displays like this: Women (3)<br /> W<br /> 7<br /> 3<br />