Re: Sv: Re: New looping method proposal
| From: | Monte Ohrt | Date: | Wed, 21 Nov 2001 20:00:37 +0000 |
| Subject: | Re: Sv: Re: New looping method proposal | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2003@lists.php.net to get a copy of this message | ||
Although using "through" looks more like an english sentence, for some
reason it doesn't sit right using that as an attribute name. I can't
quite put my finger on it though. Maybe because "through" doesn't make
sense anywhere except right after {loop ...}
{loop through=$var as=current index=foo}
{loop index=foo as=current through=$var}
Since attributes can be in any order, I wouldn't put an importance on
making the function statement look like an english sentence. I'd stick
to something like "source", or something that makes sense even outside
of the context of the function call and order of attributes.
Andrei Zmievski wrote:
>
> On Wed, 21 Nov 2001, Thies C. Arntzen wrote:
> > > The one I like so far is something like:
> > >
> > > {loop source=$array as=$element}
> >
> > {loop source=$array as=$element using=$index}
> >
> > {loop source=$array as=$element indexed_by=$index}
> >
> > {loop source=$array as=$element thiesomannblabla=$index}
> >
> >
> > something along those lines would be cool.
>
> Thieso, I didn't know you used Smarty. :)
>
> I think either of these look fine:
>
> {loop through=$array as=element key=key}
> {loop source=$array as=element key=key}
>
> The first one is easier to read.
>
> -Andrei
>
> Commitment, n.:
> Commitment can be illustrated by a breakfast of ham and eggs. The chicken
> was involved, the pig was committed.
>
> ---
> 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/