![]() |
|
No such thing as a small change | |
PerlMonks |
Re: Template Toolkit 2by lachoy (Parson) |
on Apr 14, 2001 at 17:19 UTC ( #72573=note: print w/replies, xml ) | Need Help?? |
Just a couple little things. About caching: TT2 compiles a template to a Perl subroutine and caches it, which is very fast indeed! It also allows you to save this Perl subroutine to disk so the next time a system like mod_perl starts up you don't even have to parse the template. Sweet! (Yes, I'm a big fan of TT.) Another nifty benefit that you touched on briefly is the consistent notation for variable access. For instance you can start out a template using a hash user:
user_form.tmpl
Later, you might want to make user an object which has the methods name() and last_login():
This requires no modification to your template, which makes refactoring a larger system a more palatable task. Chris
In Section
Module Reviews
|
|