line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Nephia::Plugin::View::MicroTemplate; |
2
|
2
|
|
|
2
|
|
7709
|
use 5.008005; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
91
|
|
3
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
61
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
61
|
|
5
|
2
|
|
|
2
|
|
1108
|
use parent 'Nephia::Plugin'; |
|
2
|
|
|
|
|
914
|
|
|
2
|
|
|
|
|
14
|
|
6
|
2
|
|
|
2
|
|
3522
|
use Text::MicroTemplate::File; |
|
2
|
|
|
|
|
20620
|
|
|
2
|
|
|
|
|
106
|
|
7
|
2
|
|
|
2
|
|
1323
|
use Encode; |
|
2
|
|
|
|
|
13680
|
|
|
2
|
|
|
|
|
606
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = "0.01"; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
1
|
|
|
1
|
0
|
27
|
my ($class, %opts) = @_; |
13
|
1
|
|
|
|
|
10
|
my $self = $class->SUPER::new(%opts); |
14
|
1
|
|
|
|
|
83
|
$self->app->{stash} = {}; |
15
|
1
|
|
|
|
|
16
|
$self->app->{view} = Text::MicroTemplate::File->new(%opts); |
16
|
1
|
|
|
|
|
53
|
return $self; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
1
|
32313
|
sub exports { qw/ render / } |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub render { |
22
|
2
|
|
|
2
|
1
|
16
|
my ($self, $context) = @_; |
23
|
|
|
|
|
|
|
return sub ($;$) { |
24
|
1
|
|
|
1
|
|
89
|
my ($template, $args) = @_; |
25
|
1
|
|
|
|
|
9
|
my $content = $self->app->{view}->render_file($template, $args); |
26
|
1
|
|
|
|
|
528639
|
Encode::encode_utf8($content); |
27
|
2
|
|
|
|
|
13
|
}; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
__END__ |