line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Dancer2::Template::Alloy; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: Template Alloy engine for Dancer2 |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
72312
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
34
|
|
7
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
41
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
7
|
use Carp 'croak'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
50
|
|
10
|
1
|
|
|
1
|
|
586
|
use Moo; |
|
1
|
|
|
|
|
11506
|
|
|
1
|
|
|
|
|
5
|
|
11
|
1
|
|
|
1
|
|
1798
|
use Template::Alloy; |
|
1
|
|
|
|
|
26662
|
|
|
1
|
|
|
|
|
10
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
with 'Dancer2::Core::Role::Template'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
our $VERSION = '0.002'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub _build_engine { |
18
|
1
|
|
|
1
|
|
12
|
my $self = shift; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
Template::Alloy->new( |
21
|
|
|
|
|
|
|
ABSOLUTE => 1, |
22
|
|
|
|
|
|
|
ENCODING => $self->charset, |
23
|
|
|
|
|
|
|
INCLUDE_PATH => $self->views, |
24
|
1
|
|
|
|
|
19
|
%{ $self->config }, |
|
1
|
|
|
|
|
18
|
|
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub render { |
29
|
1
|
|
|
1
|
0
|
8766
|
my ( $self, $tmpl, $vars ) = @_; |
30
|
|
|
|
|
|
|
|
31
|
1
|
50
|
|
|
|
17
|
$self->engine->process( $tmpl, $vars, \my $content ) |
32
|
|
|
|
|
|
|
or croak $self->engine->error; |
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
|
|
35006
|
$content; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |