(Top) < Rewriting our start() with Templates: | Additional Functions > |
HTML::Template support is built into CGI::Application
Many other Perl templating systems can be used (e.g.: Template Toolkit, Mason)
Simply write a replacement for load_tmpl in your module:
sub load_tmpl { my ($webapp) = @_; require Template; # create & initialize a Template Toolkit object return Template->new(%config); } sub some_run_mode { # ... my $template = $webapp->load_tmpl(); $template->process('some.tmpl', $vars); } |
CGI::Application (v.2.0) |
29 |