Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: HTML::Template vs. Template::Toolkit vs. ??

by moritz (Cardinal)
on Jan 07, 2009 at 19:44 UTC ( #734705=note: print w/ replies, xml ) Need Help??


in reply to HTML::Template vs. Template::Toolkit vs. ??

I started out with using HTML::Template, it was the first template system that I knew, and I liked it.

I then read a Catalyst tutorial, and that used TT. I really liked it, and started using TT.

My first doubts about TT came when realized that it missed a killer feature that HTML::Template had: the default_escape option. It really makes all your worries about cross-site scripting go away.

When I tried to make my web apps "Unicode Safe" I moved them from HTML::Template to HTML::Template::Compiled, which has the open_mode option to get rid of my UTF-8 worries.

I started to write more things with Catalyst, DBIx::Class and TT, and came to the conclusion that this model, while much more powerful than HTML::Template + $otherStuff, tempted me to do bad things, like issuing DB queries from within the template (if you don't know what's bad about this, just think of how you'd handle error cases).

So these days I mostly use HTML::Template::Compiled again.


Comment on Re: HTML::Template vs. Template::Toolkit vs. ??
Select or Download Code
Re^2: HTML::Template vs. Template::Toolkit vs. ??
by Anonymous Monk on Jan 08, 2009 at 05:45 UTC
      Thank you, that looks nice (although I don't see an example of how the decoding works). The last time I asked, nobody had a convenient answer, so I guess things are improving still (which is a good sign).
      what I don't quite like about that is, that if you need unescaped data, you have to decode it, so that produces extra work (encoding and directly after that decoding again), while in HTML::Template(::Compiled) no escaping at all happens if you use ESCAPE=0.
Re^2: HTML::Template vs. Template::Toolkit vs. ??
by Anonymous Monk on Apr 21, 2009 at 16:06 UTC
    I'm currently using HTML::Template and having some Unicode issues. For example a parameter of '\x{a3}' gets converted to '\x{c2}\x{a3}' in the return value of 'output' - that is the individual UTF-8 bytes appear to get interpreted as Unicode code points. For reference this is a pound sign and the Unicode code point is '00A3' and the UTF-8 hex is 'C2','A3'.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://734705]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2014-12-21 20:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (107 votes), past polls