--- Brian Glass <brian at glassbrian.com> wrote:
> Yes, content wrapping rocks. I've been told by a resident TT person
> that
> TT can do something similar to that, but I haven't seen it done
> before.
Yes, it's easy. My website (http://users.easystreet.com/ovid/) uses
this for all pages (except for the CSS where I disable the wrapper
because it's not HTML.)
> The other reason I like Mason is its component model. Components in
> Mason are scoped. So if you want a variable to be available in a
> subcomponent you pass it.
Yup. Available in TT.
> I don't know if TT does caching of compiled templates,
Yes. You have plenty of control over it, too:
COMPILE_DIR => '/tmp/ttc',
COMPILE_EXT => '.ttc2',
TT also abstracts out things that people working with templates
shouldn't neeed to know. One popular example is the ability to switch
between hashes and objects seamlessly. If you have this in your Perl:
$person->{name}
In your template it's:
person.name
Later, if you switch that to a method call:
$person->name
Your template code *does not* change.
This truly helps to separate the logic layer from the presentation
layer. It's very powerful and, I think, underappreciated.
Most Mason code that I've seen has too much logic. Of course, this
isn't a fault of Mason, but using Perl as the template language does
encourage this. Also, I've always disliked the fact that Mason
components are always compiled into the HTML::Mason::Commands
namespace, but that's a different gripe :)
Cheers,
Ovid
=====
Silence is Evil http://users.easystreet.com/ovid/philosophy/decency.html
Ovid http://www.perlmonks.org/index.pl?node_id=17000
Web Programming with Perl http://users.easystreet.com/ovid/cgi_course/
_______________________________________________
maypole mailing list
maypole at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole
This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:56 GMT