| 1 | package DTL::Fast::Tag::Dump; | ||||||||||
| 2 | 4 | ▶ | use strict; use utf8; use warnings FATAL => 'all'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 4 | ▶ | use parent 'DTL::Fast::Tag::Simple'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 4 | $DTL::Fast::TAG_HANDLERS{'dump'} = __PACKAGE__; | |||||||||
| 6 | |||||||||||
| 7 | #@Override | ||||||||||
| 8 | sub parse_parameters | ||||||||||
| 9 | { | ||||||||||
| 10 | 21 | ▶ | my $self = shift; | ||||||||
|
Subroutine
parse_parameters: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 11 | |||||||||||
| 12 | 21 | ▶ | die $self->get_parse_error("no variable specified for dumping") unless $self->{'parameter'}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | 18 | $self->{'variables'} = $self->parse_sources($self->{'parameter'}); | |||||||||
| 14 | |||||||||||
| 15 | 18 | return $self; | |||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | #@Override | ||||||||||
| 19 | sub render | ||||||||||
| 20 | { | ||||||||||
| 21 | 18 | ▶ | my ($self, $context) = @_; | ||||||||
|
Subroutine
render: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||
| 22 | |||||||||||
| 23 | 18 | require Data::Dumper; | |||||||||
| 24 | 18 | my @result = (); | |||||||||
| 25 | 18 | foreach my $variable (@{$self->{'variables'}}) | |||||||||
| 26 | { | ||||||||||
| 27 | push @result, | ||||||||||
| 28 | Data::Dumper->Dump( | ||||||||||
| 29 | [$variable->render($context, 'safe')], | ||||||||||
| 30 | 21 | ['context.'.$variable->{'original'}] | |||||||||
| 31 | ) | ||||||||||
| 32 | ; | ||||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 18 | return join "\n", @result; | |||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | 4 | 1; | |||||||||