get key foreach smarty code example
Example 1: smarty foreach
{foreach from=$myArray item=foo}
<li>{$foo}</li>
{/foreach}
OR
{foreach $aZoneRecord as $aZoneRecordKey => $aZoneRecordVal}{/foreach}
Example 2: smarty foreach
{*Array of items*}
{foreach from=$myArray item=foo}
<li>{$foo}</li>
{/foreach}
{*Key value array*}
{foreach from=$myArray key=k item=v}
<li>{$k}: {$v}</li>
{/foreach}