| 1 | package DTL::Fast::Tag::Autoescape; | ||||||||||||||
| 2 | 9 | ▶ | 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 | 9 | ▶ | use parent 'DTL::Fast::Tag'; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | |||||||||||||||
| 5 | 9 | $DTL::Fast::TAG_HANDLERS{'autoescape'} = __PACKAGE__; | |||||||||||||
| 6 | |||||||||||||||
| 7 | #@Override | ||||||||||||||
| 8 | 23 | ▶ | sub get_close_tag{ return 'endautoescape';} | ||||||||||||
|
Subroutine
get_close_tag: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||
| 9 | |||||||||||||||
| 10 | #@Override | ||||||||||||||
| 11 | sub parse_parameters | ||||||||||||||
| 12 | { | ||||||||||||||
| 13 | 14 | ▶ | my $self = shift; | ||||||||||||
|
Subroutine
parse_parameters: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||
| 14 | |||||||||||||||
| 15 | 14 | ▶ | if( $self->{'parameter'} eq 'on' ) | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 16 | { | ||||||||||||||
| 17 | 2 | $self->{'safe'} = 0; | |||||||||||||
| 18 | } | ||||||||||||||
| 19 | elsif( $self->{'parameter'} eq 'off' ) | ||||||||||||||
| 20 | { | ||||||||||||||
| 21 | 11 | $self->{'safe'} = 1; | |||||||||||||
| 22 | } | ||||||||||||||
| 23 | else | ||||||||||||||
| 24 | { | ||||||||||||||
| 25 | 1 | die $self->get_parse_error("autoescape tag undertands only `on` and `off` parameters"); | |||||||||||||
| 26 | } | ||||||||||||||
| 27 | 13 | return $self; | |||||||||||||
| 28 | } | ||||||||||||||
| 29 | |||||||||||||||
| 30 | #@Override | ||||||||||||||
| 31 | sub render | ||||||||||||||
| 32 | { | ||||||||||||||
| 33 | 12 | ▶ | my $self = shift; | ||||||||||||
|
Subroutine
render: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||
| 34 | 12 | my $context = shift; | |||||||||||||
| 35 | |||||||||||||||
| 36 | 12 | $context->push_scope()->set('_dtl_safe' => $self->{'safe'}); | |||||||||||||
| 37 | 12 | my $result = $self->SUPER::render($context); | |||||||||||||
| 38 | 12 | $context->pop_scope(); | |||||||||||||
| 39 | |||||||||||||||
| 40 | 12 | return $result; | |||||||||||||
| 41 | } | ||||||||||||||
| 42 | |||||||||||||||
| 43 | 9 | 1; | |||||||||||||