Re: Sv: Re: New looping method proposal
| From: | Jason Sweat | Date: | Tue, 27 Nov 2001 00:49:18 +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-2049@lists.php.net to get a copy of this message | ||
I guess my original idea would have been to inject some additional keys like
smartynext, smartyprev, smartyfirst and smartylast as additional values for
each item in the array.
you could then have {foreach name=foo loopover=userarray}
then %foo.index_next% could reference $userarray[foo].smartynext, etc.
Jason
----- Original Message -----
From: "Andrei Zmievski" <andrei@ispi.net>
To: <smarty@lists.ispi.net>
Cc: <smarty@lists.ispi.net>
Sent: Monday, November 26, 2001 11:49 AM
Subject: [smarty] Re: Sv: Re: New looping method proposal
> On Wed, 21 Nov 2001, Jason Sweat wrote:
> > My apologies if this suggestion is more annoying than useful, but could
you
> > perhaps solve this problem by turning the associative array into a
linked
> > list? It would required an extra pass over the array before you
generate
> > the output, but you could then have the next and previous keys stored on
> > each array item. These could then be used to approximate the
next/previous
> > functions in the {section} style loop.
>
> Might be an idea. Hey, should every {foreach..} be named? Because
> otherwuse, how would you access its properties?
>
> -Andrei
>
> "I think it would be a good idea." -- Mahatma Gandhi,
> when asked what he thought of Western civilization...
>
> ---
> You are currently subscribed to smarty as: sweatjejm@home.com
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/