Posted by Jens Kleikamp on 10/21/05 19:02
Kathleen Krause-Thompson wrote:
> Thank you for help provided in the past.
>
> This time, I am using the section tag and would like to access an array using the $smarty.section.name.index variable (see the ??? below).
>
> --------------------------------
>
> {section name=ill start=1 loop=$num+1 step=1}
>
> <p>Job Title {$smarty.section.ill.index}
>
> {if !empty($errors.budget?????.baseSalAmt)}<span id="errortext">{$errors.budget?????.baseSalAmt}</span>{/if}
>
> {/section}
>
> ----------------------------
>
> ?????? is where I would like for the $smarty.section.ill.index to go, for example {$errors.budget2.baseSalAmt}. How would I access this array variable dynamically?
>
Iám not sure, but this could work:
{section name=ill start=1 loop=$num+1 step=1}
<p>Job Title {$smarty.section.ill.index}
{if !empty($errors.budget?????.baseSalAmt)}
{assign var="index" value=budget`$smarty.section.ill.index`}
<span id="errortext">{$errors.$index.baseSalAmt}</span>
{/if}
{/section}
Navigation:
[Reply to this message]
|