Line 0
Link Here
|
0 |
- |
1 |
use Modern::Perl; |
|
|
2 |
use Template; |
3 |
use Template::Stash::AutoEscaping; |
4 |
my $tt = Template->new( |
5 |
{ |
6 |
ABSOLUTE => 1, |
7 |
PLUGIN_BASE => 'Koha::Template::Plugin', |
8 |
} |
9 |
); |
10 |
|
11 |
my $output; |
12 |
|
13 |
my @loop; |
14 |
for my $i ( 0 .. 10000 ) { |
15 |
push @loop, { |
16 |
foo => '<script>my foo</script>', |
17 |
bar => 'my bar', |
18 |
}; |
19 |
} |
20 |
my $vars = { |
21 |
pouet => 'my var', |
22 |
loop => \@loop, |
23 |
}; |
24 |
|
25 |
|
26 |
$tt->process(\*DATA, $vars, \$output ) |
27 |
|| die $tt->error(), "\n"; |
28 |
#say $output; |
29 |
|
30 |
__DATA__ |
31 |
[% pouet %] |
32 |
<div style="display:none;"> |
33 |
[% FOR l IN loop %] |
34 |
[% l.foo %] [% l.bar %] |
35 |
<br/> |
36 |
[% END %] |
37 |
</div> |