Re: Play nice! Re: Savant/Flexy/Foo template engines
| From: | Alan Knowles | Date: | Thu, 10 Jun 2004 07:55:25 +0000 |
| Subject: | Re: Play nice! Re: Savant/Flexy/Foo template engines | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-30365@lists.php.net to get a copy of this message | ||
This is a first go at overhalling the current Flexy core, and implementing the Interface as discussed.
http://devel.akbkhome.com/svn/index.php/akpear/HTML_Template/Template.php
A few points came up:
toFile().. - Seems a rather low usage method, - that gets more messy, the more you add to it.. handling resources or filenames.. etc. - I wonder if it is really a good idea to include it.. in php5 they can just do $e = $tmpl->toString(); if (!is_object($e) ) { file_put_contents($e); }
the variables I've used are public. - end users can treat them as private if they wish. (eg. use only the assign API etc,).. 99% of the time end users will not need to bother accessing them directly, but on the offchance someone wants to, as long as they understand what it does, there seems to be minimal issues with letting them loose on it.. (it's not like the API is going to change dramatically much more...... famous last words... )
I've added scope at the bottom for template specific code.. -
= parseBlock, setCurrentBlock, touchCurrentBlock ? for IT?
The options array in Flexy is tooooo big already.. - I suspect the best idea is to
a) comment out options that are not used by the core file. (leaving the documentation in there)
b) when any of the providers (that use those options) are loaded, the user provided & the provider's defaults are merged.
---------------------------------------------------------------------------------------------------------
Questions:
a) Should this be HTML_Template?
b) Should it remain as HTML_Template_Flexy
** in which case it should really be Flexy2 (even though Flexy never made it to stabe ;)
c) What is missing
d) What could be removed?
Thoughts anyone..
Regards
Alan
Don't get me wrong I voted +1 to have Savant in PEAR, but it truly is for that reason not becuase i think its the best solution or because i think its so different from other templates it can't be combined. Anyhow what i think would be great if someone who is actually willing to write some code started a PEAR Template design thread and worked out hte issues instead of all this pointless arguing. I would do it, but I can garentee i don't have the time to write anything more then an interface and thats already been done. http://www.11abacus.com/dev/pear/HTML_Template_Interface.phps -josh