Another batch of ideas

[email protected] (Andrei Zmievski) Fri, 18 Feb 2000 11:13:16 -0600
Newsgroups php.template
Message-ID <[email protected]>
After reading through Perl's HTML::Template docs I think we can steal
some ideas from them. Let's talk if these would be useful or not.

- Automatic escaping of variable contents when printing into the output
  optional control through escape=true/false attribute

- Assigning values to vars inside a specific section. I'm not sure if
  this would be useful or not.

- 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.

- Having a warning if trying to assign to a variable that is not
  mentioned in the template.

- Having a parameter that specifies whether the parsed template is
  cached.

- 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.

-Andrei
* If it's never finished, you can't prove it doesn't work. *