line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Filter::Default; |
2
|
5
|
|
|
5
|
|
3103
|
use strict; use utf8; use warnings FATAL => 'all'; |
|
5
|
|
|
5
|
|
11
|
|
|
5
|
|
|
5
|
|
122
|
|
|
5
|
|
|
|
|
24
|
|
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
30
|
|
|
5
|
|
|
|
|
125
|
|
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
234
|
|
3
|
5
|
|
|
5
|
|
26
|
use parent 'DTL::Fast::Filter'; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
29
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
$DTL::Fast::FILTER_HANDLERS{'default'} = __PACKAGE__; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
#@Override |
8
|
|
|
|
|
|
|
sub parse_parameters |
9
|
|
|
|
|
|
|
{ |
10
|
27
|
|
|
27
|
0
|
50
|
my $self = shift; |
11
|
|
|
|
|
|
|
die $self->get_parse_error("no default value specified") |
12
|
27
|
50
|
|
|
|
33
|
if not scalar @{$self->{'parameter'}}; |
|
27
|
|
|
|
|
79
|
|
13
|
27
|
|
|
|
|
52
|
$self->{'default'} = $self->{'parameter'}->[0]; |
14
|
27
|
|
|
|
|
91
|
return $self; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
#@Override |
18
|
|
|
|
|
|
|
sub filter |
19
|
|
|
|
|
|
|
{ |
20
|
16
|
|
|
16
|
0
|
28
|
my ($self, $filter_manager, $value, $context) = @_; |
21
|
|
|
|
|
|
|
|
22
|
16
|
|
66
|
|
|
82
|
return $value || $self->{'default'}->render($context); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |