Re: [PHP Template] Another batch of ideas

[email protected] (Dan Libby) Fri, 18 Feb 2000 14:36:32 -0800
Newsgroups php.template
Message-ID <[email protected]>
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. *