line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Tag::Templatetag; |
2
|
2
|
|
|
2
|
|
903
|
use strict; use utf8; use warnings FATAL => 'all'; |
|
2
|
|
|
2
|
|
3
|
|
|
2
|
|
|
2
|
|
46
|
|
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
34
|
|
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
59
|
|
3
|
2
|
|
|
2
|
|
5
|
use parent 'DTL::Fast::Tag::Simple'; |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
8
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
$DTL::Fast::TAG_HANDLERS{'templatetag'} = __PACKAGE__; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our %TAG_MAP = ( |
8
|
|
|
|
|
|
|
'openblock' => '{%', |
9
|
|
|
|
|
|
|
'closeblock' => '%}', |
10
|
|
|
|
|
|
|
'openvariable' => '{{', |
11
|
|
|
|
|
|
|
'closevariable' => '}}', |
12
|
|
|
|
|
|
|
'openbrace' => '{', |
13
|
|
|
|
|
|
|
'closebrace' => '}', |
14
|
|
|
|
|
|
|
'opencomment' => '{#', |
15
|
|
|
|
|
|
|
'closecomment' => '#}', |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
#@Override |
19
|
|
|
|
|
|
|
sub parse_parameters |
20
|
|
|
|
|
|
|
{ |
21
|
16
|
|
|
16
|
0
|
11
|
my $self = shift; |
22
|
|
|
|
|
|
|
|
23
|
16
|
50
|
|
|
|
37
|
if( not ($self->{'value'} = $TAG_MAP{$self->{'parameter'}})) |
24
|
|
|
|
|
|
|
{ |
25
|
0
|
|
|
|
|
0
|
die $self->get_parse_error("unknown template tag $self->{'parameter'}"); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
16
|
|
|
|
|
17
|
return $self; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
#@Override |
32
|
|
|
|
|
|
|
sub render |
33
|
|
|
|
|
|
|
{ |
34
|
16
|
|
|
16
|
0
|
34
|
return shift->{'value'}; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |