Re: counter as a variable
| From: | Monte Ohrt | Date: | Sun, 25 Nov 2001 19:05:17 +0000 |
| Subject: | Re: counter as a variable | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2039@lists.php.net to get a copy of this message | ||
{$images_name[$picnumber]}
Jorge Restrepo - WebTeam wrote:
> Thanks Monte :)
>
> From: Monte Ohrt [mailto:monte@ispi.net]
>
> >Maybe we could add a new attribute to counter:
> >{counter assign="varname"}
> >{$varname}
>
> Great idea. (math equation ="x + y" assign="varname"} would be also very
> useful.
>
> > this is currently one workaround:
> > {capture name="varname"}{counter}{/capture}
> > {$smarty.capture.varname}
>
> It works! :)
>
> However,I thought this should work. But it doesn't:
>
> {counter start=1}
> {capture name="cell"}{counter}{/capture}
> {assign var="picnumber" value=$smarty.capture.cell}
> {$images_name[picnumber]}
>
> There is no output for {$images_sr[picnumber]} eventhough there is a proper
> array for $images_name.
>
> any thoughts?
>
> Thanks
> Jorge
>
> ---
> You are currently subscribed to smarty as: monte@ispi.net
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/