Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: I need to template this

by friedo (Prior)
on Apr 19, 2007 at 16:19 UTC ( [id://610981]=note: print w/replies, xml ) Need Help??


in reply to I need to template this

I like Template Toolkit, but that's probably because it's what I use the most. Here's what I like about TT.
  • Default syntax stands out from HTML (however, I believe you can change the default HTML::Template syntax if you want.)
  • You can call methods on objects passed to your templates. Some people abhor this, but I like to do it for Class::DBI and DateTime objects.
  • TT has built in methods for iterating over hashes and arrays, whereas with HT you have to coerce things into an AoH to iterate. TT even allows recursion.
  • It's easy to install new VMethods in TT for doing things to arrays and hashes (and scalars.) This can be a real time-saver if you don't want to do these things in your Perl code.
  • TT has a lot of plugins available, for handling everything from LaTeX to DOM stuff within your templates.
  • You can embed Perl in your templates. This has never seemed like a good idea to me, but it's there if you want it.
You might also want to read a bit about HTML::Mason, which lets you embed Perl in HTML, PHP-style.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-03-29 07:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found