Re: New array indexing problem
| From: | Andrei Zmievski | Date: | Wed, 02 May 2001 19:25:43 +0000 |
| Subject: | Re: New array indexing problem | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-671@lists.php.net to get a copy of this message | ||
Try 1.4.0b2 that's just been posted.
On Wed, 02 May 2001, Mirko Buffoni wrote:
> Other problem: with version 1.3.2, this template worked fine
>
> {section name=idx loop=$PersonalData}
> {if $idx.index/PersonalData.Mandatory == "yes"}
> {if $idx.index/PersonalData.FieldType == "radio"}
> {include file=form_check_radio.tpl base=#maintest_form_jsbase#
> field=$idx.index/PersonalData.FieldName
> value=$idx.index/PersonalData.FieldValue
> msg="$CheckFieldRadio: "}
> {else}
> {include file=form_check_text.tpl base=#maintest_form_jsbase#
> field=$idx.index/PersonalData.FieldName
> value=$idx.index/PersonalData.FieldValue
> msg="$CheckFieldText: "}
> {/if}
> {/if}
> {/section}
>
> Now (1.4.0)
>
> {section name=idx loop=$PersonalData}
> {if $PersonalData[idx].Mandatory == "yes"}
> {if $PersonalData[idx].FieldType == "radio"}
> {include file=form_check_radio.tpl base=#maintest_form_jsbase#
> field=$PersonalData[idx].FieldName
> value=$PersonalData[idx].FieldValue
> msg="$CheckFieldRadio: "}
> {else}
> {include file=form_check_text.tpl base=#maintest_form_jsbase#
> field=$PersonalData[idx].FieldName
> value=$PersonalData[idx].FieldValue
> msg="$CheckFieldText: "}
> {/if}
> {/if}
> {/section}
>
> In the form*.tpl templates, field, and value are empty.
>
> Notice, that $PersonalData[idx].FieldName or FieldValue alone, are correctly
> evaluated. Also, the {if $PersonalData[idx].FieldType ...} is correctly
> evaluated,
> thus I presume the new indexing system is not working correctly with
> {include},
> or I'm doing a big mistake! PersonalData array is defined this way:
>
> $tpl->assign( "PersonalData",
>
> array( 0 => array( "FieldName" => "Name",
> "FieldValue" => "Real Name",
> "FieldType" => "text",
> "Mandatory" => "yes"
> ),
> 1 => array( "FieldName" => "Duty",
> "FieldValue" => "Req. Duty",
> "FieldType" => "text",
> "Mandatory" => "yes"
> ),
> ...
> )
> )
>
>
> Thanks a lot for any help
>
> Mirko Buffoni
>
> ---
> You are currently subscribed to smarty as: andrei@ispi.net
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
-Andrei
"The galaxy is, in other words, an immensely, intrinsically,
and inexhaustibly interesting place." -- Iain M. Banks