| 1 | package HTML::FormHandler::Widget::Wrapper::SimpleInline; | ||||||||||||||||||||||||||||
| 2 | # ABSTRACT: simple field wrapper | ||||||||||||||||||||||||||||
| 3 | 1 | $HTML::FormHandler::Widget::Wrapper::SimpleInline::VERSION = '0.410002'; | |||||||||||||||||||||||||||
| 4 | 1 | ▶ | use Moose::Role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use HTML::Entities qw( encode_entities ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 1 | with 'HTML::FormHandler::Widget::Wrapper::Base'; | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 1 | ▶ | sub wrap_field { | ||||||||||||||||||||||||||
|
Subroutine
wrap_field: called CC=7 SCAR=37.2
Pod
undocumented
| |||||||||||||||||||||||||||||
| 12 | 1 | my ( $self, $result, $rendered_widget ) = @_; | |||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 1 | ▶ | return $rendered_widget if $self->has_flag('is_compound'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 0 | my $output = "\n"; | |||||||||||||||||||||||||||
| 17 | 0 | my $tag = $self->wrapper_tag; | |||||||||||||||||||||||||||
| 18 | 0 | my $start_tag = $self->get_tag('wrapper_start'); | |||||||||||||||||||||||||||
| 19 | 0 | ▶ | if( defined $start_tag ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 20 | 0 | $output .= $start_tag; | |||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||
| 22 | else { | ||||||||||||||||||||||||||||
| 23 | 0 | $output .= "<$tag" . process_attrs( $self->wrapper_attributes($result) ) . ">"; | |||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 0 | ▶ | if ( $self->do_label && length( $self->label ) > 0 ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->do_label and length $self->label > 0
MC/DC0%0/2
$self->do_label and length $self->label > 0
$self->do_label
length $self->label > 0
Truth table0%0/3
A and B
A= $self->do_labelB= length $self->label > 0
| |||||||||||||||||||||||||||||
| 27 | 0 | $output .= $self->do_render_label($result); | |||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 0 | $output .= $rendered_widget; | |||||||||||||||||||||||||||
| 31 | $output .= qq{\n<span class="error_message">$_</span>} | ||||||||||||||||||||||||||||
| 32 | 0 | for map { encode_entities($_) } $result->all_errors; | |||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 0 | my $end_tag = $self->get_tag('wrapper_end'); | |||||||||||||||||||||||||||
| 35 | 0 | ▶ | $output .= defined $end_tag ? $end_tag : "</$tag>"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 0 | return "$output\n"; | |||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 1 | 1; | |||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | __END__ | ||||||||||||||||||||||||||||