Re: Sv: Re: New looping method proposal

From: Date: Thu, 22 Nov 2001 02:39:20 +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-2028@lists.php.net to get a copy of this message
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. 2 cents :) Jason ----- Original Message ----- From: "Andrei Zmievski" <andrei@ispi.net> Sent: Wednesday, November 21, 2001 5:06 PM Subject: [smarty] Re: Sv: Re: New looping method proposal > On Thu, 22 Nov 2001, Bertrand DUNOGIER wrote: > > index_prev, index_next, etc already exist, don't they ? :) > > (http://www.phpinsider.com/php/code/Smarty/docs/x706.htm#BUILTIN.FUNCTIONS.S ECTION) > > They mean next index, previous index, yes. > > > > By instance, i've been using index_next when i wanted to make > > something special on the current value if the next value had a > > particular value. > > <sigh> They exist for {section..}. I'm asking about {foreach..}. > > -Andrei

« previous php.smarty.general (#2028) next »