Re: [SMARTY] Using variables to point to array positions.
| From: | olinux | Date: | Tue, 13 May 2003 04:55:49 +0000 |
| Subject: | Re: [SMARTY] Using variables to point to array positions. | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9540@lists.php.net to get a copy of this message | ||
Try this
note: $transaction.transactionCreator is still == 22
{assign var=x value=$transaction.transactionCreator}
{$x} - {$ticket.users.x.name|escape:"htmlall"}
--- William Bailey <wb@pro-net.co.uk> wrote:
> Hi All,
>
> I can't seem to get the following working:
>
> assume that $transaction.transactionCreator = 22
>
>
{$ticket.users[
$transaction.transactionCreator].name|escape:"htmlall"}
> ({$transaction.transactionCreator})
> {$transaction.transactionCreated|escape:"htmlall"}
>
> I have tried a number of different syntax changes
> but so far haven't had any
> luck. Now if i replace
> $transaction.transactionCreator with 22 then all
> is
> well but i really need to be able to point to an
> array position with another
> variable, can this be done?
>
> I can work arround it by putting a reference to the
> correct variable before
> the data gets assigned to smarty but that just seems
> like complicating the
> issue.
>
> Thanks in advance.
>
> --
> Regards,
> William Bailey.
> Pro-Net Internet Services Ltd.
> http://www.pro-net.co.uk
> http://wb.pro-net.co.uk
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com