Friday, March 16, 2007

Perl Template::Toolkit の例

for ( my $key = 1; $key <= 10; $key++ ) {
push (@list, { pattern =>"pattern".$key, hoge=>$key, hoge2=>'hoge'} );
}

$self->stash->{list}= \@list;

-------
[% FOREACH r = list %]  [% r.pattern html %] [% r.hoge html %] [% r.hoge2 html %] [% END %]

No comments: