OT: Templating systems (was RE: [Catalyst] New default screen
sam at vilain.net
Fri Oct 21 01:21:40 CEST 2005
On Wed, 2005-10-19 at 17:46 +0200, arnaud at underlands.org wrote:
> > Personally, I don't see how HTML::Template is any different from how I
> > use TT, except:
> > 1. It's more verbose <TMPL_VAR NAME=FOO> versus [% foo %]
> It *enforces* a stronger separation between code and presentation.
> I'm aware that a *complete* separation is not possible or at least not
> the best thing.
> You can only display variable, have conditional display and make loop in
> your template, no possibility to throw in filters, or expression (at
> least not in the basic H::T) or other things which relate to code (and
> not presentation) to my mind
I would disagree with this. I think by being so inflexible, it just
shifts a lot of the presentation work into the code that feeds the data
to the page. In my view I should be able to substitute the HTML
template with an XML template and not worry about whether the code that
pre-prepares the HTML to put in the template needs to change.
In other words, as HTML::Template requires HTML input for all its
variables, it is not really a complete presentation layer.
On the other hand, with TT I can usually just happily pass the template
my objects, and get it to do all the presentation logic. Complete
You can *enforce* that the separation is complete in other ways. For
instance, if you are using the Tangram model, then you simply don't pass
in a storage handle to your template, so that no model changes are
possible from the view.
More information about the Catalyst