For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > October 2006 > Re: [SMARTY] problem with dynamic "array key" in smarty









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SMARTY] problem with dynamic "array key" in smarty
Ken Snyder

2006-10-30, 7:33 pm

Are you looking for

{$be[$hno.sno]}

?

rs_satya wrote:
> I need to send an array value as a key to another array dynamically in a
> template.
> pls . Help me.
>
> the sample code is as follows:
>
> {foreach name=outer item=hno key=key from=$hoas}
> <tr>
> <td>
> {$hno.sno} //OK
>
> {$be[{$hno.sno}]} //I tried like this -- Wrong
>
> // Here I need to send this {$hno.sno} value as a key to {$be[]} associative
> array.
>
> </td>
> </tr>
> {/foreach}
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com