Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^3: Templating algorithm - pass in variables vs callback?by Thilosophy (Curate) |
on Mar 01, 2005 at 03:14 UTC ( [id://435267]=note: print w/replies, xml ) | Need Help?? |
Actually, HTML::Template allows you to pass in subroutines which will get called to get the parameter values:
However, since these subroutines cannot be parameterized from within the template, I am not sure how much use this is. I'd love to be able to do the following (which is not supported, however):
I think HTML::Template should have some simple kind of expression language that would allow you to these things, as well as drilling down into hashes and arrays, accessing objects (which should eliminate the need for callbacks), and doing simple arithmetics . HTML::Template::Expr is doing some of these things already. (Like everyone else, I have started to implement my own templating system with these ideas in mind. It is mostly a project to teach myself about Parrot, but if you are interested: http://budgie.sourceforge.net/ )
In Section
Seekers of Perl Wisdom
|
|