Re: [PHP Template] Repeating values
[email protected] (Dan Libby) Tue, 29 Feb 2000 16:19:30 -0800
| Newsgroups | php.template |
|---|---|
| Message-ID | <[email protected]> |
I think it would be a useful feature. However now you are starting to get into
the area of collation. Previously I worked with a template language that had
several options for collating multiple lists. It gets a bit tricky.... ;-)
-dan
Andrei Zmievski wrote:
> Right now the spec mentions the following:
>
> * repeat = yes/no
> repeat the last value of the variable inside the section loop
> if the other variables have more values, if not specified,
> defaults to yes
>
> I'm wondering if it should be extended to allow either repeating of the
> last value the variable has, or of the default value. Example:
>
> {{ section sec1 }}
> {{ $foo default="green" repeat=yes }}, {{ $bar }}
> {{/section sec1 }}
>
> If $foo has 2 values ("red" and "blue"), and $bar has 4 values ("small",
> "medium", "large", "x-large"), then "blue" will be repeated:
>
> red, small
> blue, medium
> blue, large,
> blue, x-large
>
> If we specify repeat=default, though, it would do:
>
> red, small
> blue, medium
> green, large
> green, x-large
>
> Would this be a useful behavior or not?
>
> -Andrei
>
> Any sufficiently advanced Operating System
> is indistinguishable from Linux.
> - Jim Dennis
>
> --
> PHP Template Engine Mailing List
> Current engine specification can be found at:
> http://va.php.net/~andrei/tpl-engine-spec.txt
> To unsubscribe, e-mail: [email protected]