Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Perl 中,通过使用 Template Toolkit,这就是我所做的
Perl
my $vars = { name => 'Count Edward van Halen', }; $tt->process('letters/overdrawn', $vars) || die $tt->error(), "\n";
HTML
Dear [% name %],
在Mako模板中,我该怎么做?检查他们的render功能,没有得到太多提示。
render
使用命名参数
mytemplate.render(myvar1="var1", mydict=dict())
在mako方面你会做
${myvar1} % for val in mydict: ${val} % endfor