Re: [PHP Template] Repeating values
| From: | Dan Libby | Date: | Wed, 01 Mar 2000 00:19:30 +0000 |
| Subject: | Re: [PHP Template] Repeating values | ||
| References: | 1 | Groups: | php.template |
| Request: | Send a blank email to php-template+get-260@lists.php.net to get a copy of this message | ||
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: php4beta-unsubscribe@lists.php.net