line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DTL::Fast::Tag::Firstof; |
2
|
3
|
|
|
3
|
|
1073
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
69
|
|
3
|
3
|
|
|
3
|
|
13
|
use utf8; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
65
|
|
4
|
3
|
|
|
3
|
|
72
|
use warnings FATAL => 'all'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
89
|
|
5
|
3
|
|
|
3
|
|
12
|
use parent 'DTL::Fast::Tag::Simple'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
14
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
$DTL::Fast::TAG_HANDLERS{firstof} = __PACKAGE__; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
#@Override |
10
|
|
|
|
|
|
|
sub parse_parameters |
11
|
|
|
|
|
|
|
{ |
12
|
23
|
|
|
23
|
0
|
33
|
my $self = shift; |
13
|
23
|
|
|
|
|
74
|
$self->{sources} = $self->parse_sources($self->{parameter}); |
14
|
23
|
|
|
|
|
46
|
return $self; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
#@Override |
18
|
|
|
|
|
|
|
sub render |
19
|
|
|
|
|
|
|
{ |
20
|
11
|
|
|
11
|
0
|
20
|
my ( $self, $context, $global_safe) = @_; |
21
|
11
|
|
|
|
|
18
|
my $result = ''; |
22
|
|
|
|
|
|
|
|
23
|
11
|
|
|
|
|
13
|
foreach my $source (@{$self->{sources}}) |
|
11
|
|
|
|
|
20
|
|
24
|
|
|
|
|
|
|
{ |
25
|
58
|
100
|
|
|
|
131
|
if ($result = $source->render($context, $global_safe)) |
26
|
|
|
|
|
|
|
{ |
27
|
11
|
|
|
|
|
21
|
last; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
11
|
|
|
|
|
43
|
return $result; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |