Re: [PHP Template] Another batch of ideas
[email protected] (Dan Libby) Fri, 18 Feb 2000 13:20:59 -0800
| Newsgroups | php.template |
|---|---|
| Message-ID | <[email protected]> |
> - Automatic escaping of variable contents when printing into the output > optional control through escape=true/false attribute yes, very good. > - Assigning values to vars inside a specific section. I'm not sure if > this would be useful or not. couldn't hurt. shouldn't be hard to do. > - How template path is figured out. The HTML::Template does this: > > The file specified can be a full path - beginning with a '/'. If it > isn't a full path, the path to the enclosing file is tried first. After > that the path in the environment variable HTML_TEMPLATE_ROOT is tried > next, if it exists. Next, the "path" new() option is consulted. As a > final attempt, the filename is passed to open() directly. > > Instead of HTML_TEMPLATE_ROOT, we could have an .ini setting. It could > also check doc_root. Yeah, I think it should default to doc_root unless ini setting is in effect. > - Having a warning if trying to assign to a variable that is not > mentioned in the template. This should definitely be optional. You might have a piece of code sitting around, and some of it becomes obsolete, so the designer just removes the references to the unneeded variables. If the warnings were on, the code would also have to be changed. > - Having a parameter that specifies whether the parsed template is > cached. I prefer a global setting. I suppose there could be a cacheable="no" parameter for the include tag, but what's the point? I suppose there could be some memory savings... > - Having something like HTML::Template's __FIRST__, __INNER__, __LAST__ > special variables that get activated when we're in first, middle, or > last iteration of the section loop. Maybe also a number __LOOPNUM__ or > something that is evaluated to 1, 2, 3, etc. That is very interesting. That allows for doing table headers, footers, etc, all in one section. I like it. -dan