03 June 2006
This post may be outdated due to it was written on 2006. The links may be broken. The code may be not working anymore. Leave comments if needed.
Catalyst::View::TT 从 0.23 起将多了一个函数叫做 render. 一个最常见的用法是:
   $c->email(
header => [
To => '[email protected]',
Subject => 'A TT Email',
],
body => $c->view('TT')->render($c, 'email.tt', {
additional_template_paths => [ $c->config->{root} . '/email_templates'],
email_tmpl_param1 => 'foo'
}
),
);
以前我们经常得用 SubRequest 来做这事。
可看起来 render 似乎更干净一些。:)


blog comments powered by Disqus