Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Extending HTML::Template, how to do it?by mpeters (Chaplain) |
on Jun 17, 2005 at 00:54 UTC ( [id://467516]=note: print w/replies, xml ) | Need Help?? |
Have you asked these questions on the HTML::Template list? You could probably get a few really good ideas from them. In the meantime, you should look at HTML::Template::Expr which will let you execute functions inside of your templates. You could probably do something like
then in your template I would also suggest you look at CGI::Application::Plugin::AnyTemplate as well. Eventialy I will want to change CGI::App (or create something similar) to add this functionality and also strip of a need to define wich methods are OK to be run_modes. Idea that I have is simply alow any sub whose name doesnt start with _. Look at CGI::Application::Plugin::AutoRunMode for something very similar that uses method attributes to designate a sub as a run mode. But I really think that using a leading '_' on a method a really bad idea. It would be completely counter-intuitive to what any other perl programmer would think since it's tradition for '_' to make private methods. -- More people are killed every year by pigs than by sharks, which shows you how good we are at evaluating risk. -- Bruce Schneier
In Section
Seekers of Perl Wisdom
|
|