Template::Recall is a "Reverse callback" templating system.
SYNOPSIS
use Template::Recall;
my $tr = Template::Recall->new( template_path => '/path/to/template/sections' );
my @prods = (
'soda,sugary goodness,$.99',
'energy drink,jittery goodness,$1.99',
'green tea,wholesome goodness,$1.59'
);
$tr->render('header');
# Load template into memory
$tr->preload('prodrow');
for (@prods)
{
my %h;
my @a = split(/,/, $_);
$h{'product'} = $a[0];
$h{'description'} = $a[1];
$h{'price'} = $a[2];
print $tr->render('prodrow', %h);
}
# Remove template from memory
$tr->unload('prodrows');
print $tr->render('footer');
Template::Recall works using what I call a "reverse callback" approach. A "callback" templating system (i.e. Mason, Apache::ASP) generally includes template markup and code in the same file. The template "calls" out to the code where needed. Template::Recall works in reverse. Rather than inserting code inside the template, the template remains separate, but broken into sections. The sections are called from within the code at the appropriate times.
Product's homepage
Requirements:
· Perl