RE: [SMARTY] function alternate
| From: | G | Date: | Thu, 02 May 2002 21:23:04 +0000 |
| Subject: | RE: [SMARTY] function alternate | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-4012@lists.php.net to get a copy of this message | ||
Add a delimiter attribute :)
Gerard
> -----Original Message-----
> From: Monte Ohrt [mailto:monte@ispi.net]
> Sent: Thursday, May 02, 2002 3:25 PM
> To: mark priatel
> Cc: 'Smarty'
> Subject: Re: [SMARTY] function alternate
>
>
> cycle is definately a more suited name for something that handles more
> than two values.
>
> {cycle values="#eeeeee,#d0d0d0,#ffffff"}
>
> I definately like the syntax better than var1, var2, ...
> Is it going to work OK for the vast majority using comma as a delimiter?
>
>
> alternate currently allows you to alternate without printing, much like
> you did where you don't advance when you print. either method works for
> two values, but three or more, your idea works better. Or maybe both
> ideas could be incorporated?
>
> Monte
>
> mark priatel wrote:
> > Actually, I wrote a similar plugin a few days ago. {alternate} is
> > definitely something that should be part of the smarty dist. My version
> > was similar:
> >
> > - it accepts values as comma delim list, supporting more than 2 items
> > - it allows the last value to be returned without advancing to the next
> > value (useful for when you you have, say, colors alternating every 2
> > rows)
> > - it can be reset
> >
> > I like how yours allows for nesting -- definitely something worth
> > having.
> >
> > -mark
> >
> >
>
> --
> Monte Ohrt <monte@ispi.net>
> Director of Technology, ispi Inc.
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>