tinita has asked for the wisdom of the Perl Monks concerning the following question:
I'm writing a template system. before everybody says, omg, not another one, please let me explain a bit =)
I personally like HTML::Template because of its restrictions, because it is small and easy to use. what I don't like is that it is not too fast. it's fast enough for many applications, but sometimes you want it faster =)
I also don't like that you either just have access to the current level of parameters, or to every level. another thing is the syntax TMPL_*. (ok, I know i can use filters...).
also you always have to feed it a hash, it can't work with object-methods.
if I'm wrong with some of these assumptions above or below, I'm glad if you correct me.
I've also looked at Template-Toolkit, but I'm not too happy with its syntax either. what I don't know is how fast it is and how much memory it uses compared to other systems. I haven't found a comparison in the web yet.
Well, and last but not least, I wanted to see if I can program it myself =)
one question I have is about the module name - the Template-namespace is practically "owned" by TT. As my module started from HTML::Template I called it HTML::Template::Compiled (HTC). I like the name; is it too long though?
the manpage of the current version is located at HTC.html, you can download it at HTML-Template-Compiled-0.28.tar.gz (or for the latest version my download section)
I'd be glad about any comments.
The first goal of the module is that it works with most HTML::Template files (doesn't implement all features of it, though), and that it is faster than that.
it compiles the template to perl code (like TT can do).
update: I'm also interested in what features HTML::Template users would like to see implemented.
update2: I added case_insensitive var names (optional) in version HTML-Template-Compiled-0.30.tar.gz and the benchmark script is now in examples/bench.pl
update3: i'm now thinking about 'Text::CTemplate' which hides the origin but is a better namespaces IMHO.
update 27.08.2005: on CPAN now: HTML::Template::Compiled
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: developing a template system
by chromatic (Archbishop) on Aug 12, 2005 at 22:09 UTC | |
by tinita (Parson) on Aug 12, 2005 at 22:17 UTC | |
by cees (Curate) on Aug 13, 2005 at 22:54 UTC | |
|
Re: developing a template system
by perrin (Chancellor) on Aug 12, 2005 at 23:49 UTC | |
by tinita (Parson) on Aug 13, 2005 at 00:06 UTC | |
by perrin (Chancellor) on Aug 13, 2005 at 03:38 UTC | |
by tinita (Parson) on Aug 13, 2005 at 10:05 UTC | |
by perrin (Chancellor) on Aug 22, 2005 at 03:02 UTC | |
| |
|
Re: developing a template system
by westernflame (Sexton) on Aug 13, 2005 at 23:57 UTC | |
|
Re: developing a template system
by astroboy (Chaplain) on Aug 14, 2005 at 09:03 UTC |