line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::TemplateServer::Provider::HTML::Template; |
2
|
2
|
|
|
2
|
|
96623
|
use Moose; |
|
2
|
|
|
|
|
9889036
|
|
|
2
|
|
|
|
|
19
|
|
3
|
2
|
|
|
2
|
|
138139
|
use HTML::Template; |
|
2
|
|
|
|
|
43674
|
|
|
2
|
|
|
|
|
104
|
|
4
|
2
|
|
|
2
|
|
3846
|
use Method::Signatures; |
|
2
|
|
|
|
|
150567
|
|
|
2
|
|
|
|
|
14
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
with 'App::TemplateServer::Provider::Filesystem'; |
9
|
|
|
|
|
|
|
|
10
|
2
|
0
|
|
2
|
|
13672694
|
method render_template($template_file, $context){ |
|
0
|
0
|
|
0
|
|
|
|
|
0
|
0
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
11
|
0
|
|
|
|
|
|
my $template = HTML::Template->new( |
12
|
|
|
|
|
|
|
path => scalar $self->docroot, |
13
|
|
|
|
|
|
|
filename => $template_file, |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
0
|
0
|
|
|
|
|
my %data = %{$context->data||{}}; |
|
0
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
for my $var (keys %data){ |
18
|
0
|
|
|
|
|
|
my $value = $data{$var}; |
19
|
0
|
|
|
|
|
|
$template->param($var => $value); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
return $template->output; |
23
|
|
|
|
|
|
|
}; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
App::TemplateServer::Provider::HTML::Template - serve HTML::Template templates with App::TemplateServer |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 SYNOPSIS |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Use HTML::Template templates with L<App::TemplateServer|App::TemplateServer>. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
template-server --provider HTML::Template --docroot /your/templates |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
See L<template-server> and L<App::TemplateServer> for details. |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 AUTHOR AND COPYRIGHT |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Jonathan Rockway C<< <jrockway@cpan.org> >> |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
This module is Free software, you may redistribute it under the same |
46
|
|
|
|
|
|
|
terms as Perl itself. |
47
|
|
|
|
|
|
|
|