> I would be interested in seeing how many use TT vs HT.

I switched late last year from HT to TT for all new apps. I really like HT,
but TT made my life easier:

1. TT's dot notation means I just throw my data structures at the template,
and hey it all works (this is now supported in HTML::Template::Plugin::Dot,
I believe).
2. TT allows you to set parameters in included templates, and this is the
clincher for me: 

a) Whenever I have a list of data, chances are I want paging. I pass the
list of data and a Data::Page::Navigation object to my the main template*,
and the pager.tmpl which is included by all list-type templates will
automatically show my pagination. Because object methods are accessible with
the dot notation, I can access things like pager.previous_page,
pager.next_page, pager.last_page etc to. (I'm pretty careful about trying to
keep business logic out of the templates, but as far as I'm concerned,
things like paging are part of the display logic)

*(If you pass a DBIx::Class resultset to your template, you get a Data::Page
object automatically, making pagination real easy. Other ORMs may support
this too)

b) My header is pretty much standard for each page, except for some
context-specific info. I simply include header.tmpl and it receives any
context-specific parameters I specified when I call the main template.

I had ways of doing this in HT, but I had to jump through hoops to get what
I wanted

Dan


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to