line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MojoX::Renderer::HTC; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
2617893
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
70
|
|
4
|
2
|
|
|
2
|
|
9
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
65
|
|
5
|
2
|
|
|
2
|
|
446
|
use Mojo::Base 'Mojolicious::Plugin'; |
|
2
|
|
|
|
|
6708
|
|
|
2
|
|
|
|
|
13
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
3386
|
use HTML::Template::Compiled; |
|
2
|
|
|
|
|
112899
|
|
|
2
|
|
|
|
|
14
|
|
8
|
|
|
|
|
|
|
__PACKAGE__->attr( htc_args => sub { return {} }); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# ABSTRACT: HTML::Template::Compiled renderer for Mojo |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub build { |
15
|
2
|
|
|
2
|
1
|
270
|
my $self = shift->SUPER::new(@_); |
16
|
2
|
|
|
|
|
28
|
my %args = @_; |
17
|
|
|
|
|
|
|
|
18
|
2
|
|
|
|
|
74
|
$self->htc_args(\%args); |
19
|
|
|
|
|
|
|
|
20
|
2
|
|
|
2
|
|
30884
|
return sub { $self->_render(@_) } |
21
|
2
|
|
|
|
|
35
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub _render { |
24
|
2
|
|
|
2
|
|
3
|
my ($self, $r, $c, $output, $options) = @_; |
25
|
|
|
|
|
|
|
|
26
|
2
|
|
|
|
|
9
|
my $name = $r->template_name($options); |
27
|
2
|
|
|
|
|
279
|
my $stash = $c->stash; |
28
|
|
|
|
|
|
|
|
29
|
2
|
|
|
|
|
35
|
my $template = HTML::Template::Compiled->new( |
30
|
2
|
|
|
|
|
12
|
%{ $self->htc_args }, |
31
|
|
|
|
|
|
|
filename => $name, |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
|
34
|
2
|
|
|
|
|
3895
|
$template->param( |
35
|
|
|
|
|
|
|
%$stash, |
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
|
38
|
2
|
|
|
|
|
49
|
$$output = $template->output; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; # End of MojoX::Renderer::HTC |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |