Reputation: 42700
In Perl, by using Template Toolkit, here is what I do
Perl
my $vars = {
name => 'Count Edward van Halen',
};
$tt->process('letters/overdrawn', $vars)
|| die $tt->error(), "\n";
HTML
Dear [% name %],
In Mako template, how can I do so? Check through their render
function, doesn't get much hint.
Upvotes: 3
Views: 5719
Reputation: 4489
Use named arguments
mytemplate.render(myvar1="var1", mydict=dict())
In the mako side you'd do
${myvar1}
% for val in mydict:
${val}
% endfor
Upvotes: 7