Re: [PHP Template] Another batch of ideas
| From: | Dan Libby | Date: | Fri, 18 Feb 2000 22:36:32 +0000 |
| Subject: | Re: [PHP Template] Another batch of ideas | ||
| References: | 1 2 3 4 5 | Groups: | php.template |
| Request: | Send a blank email to php-template+get-181@lists.php.net to get a copy of this message | ||
I was thinking particularly of when you really want to use something in the scalar context,
so you could say max="1" and it won't repeat. Ranges are also useful when you are
doing
multiple page result sets, although without access to URL args, the template really
couldn't control that.
We had a "max" feature in a previous template language I worked on, and it was often used,
however in that case the max could be filled in via another call to the database. In our
case, where it is static, you're correct that it might not have that many uses.
One use I can think of:
PHP code obtains result set from DB (say a list of headlines). It iterates over all the
results and assigns them to variables. The designer is then able to play with how many
headlines should actually be displayed. Somewhat weak, I know.
-dan
Andrei Zmievski wrote:
> On Fri, 18 Feb 2000, Dan Libby wrote:
> > In my implementation, there is no "outside". Everything is a section. The main
> > body of the page is an implicit section, so if there are looping variables, the
> > whole body loops. I'm not claiming that is necessarily "correct", however
> > it was
> > easier just to treat everything the same. I do think that we should add min and max
> > attributes to the section tag to control the range of the loop.
>
> Hmm. Why should the designer control min/max? It seems more of
> programmer's job.
>
> -Andrei
> * Power corrupts. Atomic power corrupts atomically. *