{assign var=itr value=1} {foreach $PatientChronicByDate as $pre} {capture assign=itr}{$itr+1}{/capture} {/foreach} {literal} {/literal}