[PEPr] Comment on HTML::Template_Savant
| From: | PEPr | Date: | Tue, 01 Jun 2004 21:03:57 +0000 |
| Subject: | [PEPr] Comment on HTML::Template_Savant | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-29844@lists.php.net to get a copy of this message | ||
Paul Jones (http://pear.php.net/user/pmjones) has commented on the proposal for
HTML::Template_Savant.
Comment:
Greg Beaver said, in response to Lukas:
> how hard would it be to provide API aliases to
> existing PEAR templates? This could even be in
> optional wrapper classes in separate files that
> extend Savant.
This is an excellent point. Savant is flexible enough, with its plugin and filter architecture,
that it might serve as a base class to mimic other template engines. This is not something I'd
like to do by myself, but it could be done.
For example, to make Savant do a simple find-and-replace on tokens, you could write an output filter
to look for "{$...}" and replace with the assigned token value.
Similarly, if somone else likes to use TAL-like tags, Savant could act as the base for variable
storage and assignment, and an extended Savant (or even an output filter) could look for
"<tal:var_name>" or "<tal:loop_name>...</tal:loop_name>" and
apply the appropriate logic.
Likewise, if internationalization is your thing, you might write a plugin that places the proper
text at runtime, or a filter that applies a GetText method to the entire output at once.
Indeed, one could extend Savant in any number of ways to get the same results as most if not all the
existing template engines in PEAR; I'm certain there would be some differences, but on the
whole and in the main, it might be do-able. Just not by myself alone. :-)
Now that Greg brings it up, it seems to me that if PEAR is looking for template system unification,
Savant might be a good base to start from, becuase it has the most powerful template language
available to it (PHP itself) and has such a flexible plugin and filter architecture -- and all
without compiling!
Perhaps I am overly enthusiastic about the idea. :-)
Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=83
--
Sent by PEPr, the automatic proposal system at http://pear.php.net