| 1 | package HTML::FormHandler::Widget::Field::Span; | ||||||||||||||||||||
| 2 | # ABSTRACT: button field rendering widget | ||||||||||||||||||||
| 3 | 2 | $HTML::FormHandler::Widget::Field::Span::VERSION = '0.410002'; | |||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | 2 | ▶ | use Moose::Role; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 2 | ▶ | use HTML::FormHandler::Render::Util ('process_attrs'); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | 2 | ▶ | use namespace::autoclean; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 3 | ▶ | sub render_element { | ||||||||||||||||||
|
Subroutine
render_element: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||
| 10 | 3 | my ( $self, $result ) = @_; | |||||||||||||||||||
| 11 | 3 | ▶ | $result ||= $self->result; | ||||||||||||||||||
|
Condition33%1/3
$result ||= $self->result
MC/DC0%0/2
$result ||= $self->result
$result
$self->result
Truth table33%1/3
A ||= B
A= $resultB= $self->result
| |||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 3 | my $output = '<span'; | |||||||||||||||||||
| 14 | 3 | $output .= ' id="' . $self->id . '"'; | |||||||||||||||||||
| 15 | 3 | $output .= process_attrs($self->element_attributes($result)); | |||||||||||||||||||
| 16 | 3 | $output .= '>'; | |||||||||||||||||||
| 17 | 3 | $output .= $self->value; | |||||||||||||||||||
| 18 | 3 | $output .= '</span>'; | |||||||||||||||||||
| 19 | 3 | return $output; | |||||||||||||||||||
| 20 | } | ||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 3 | ▶ | sub render { | ||||||||||||||||||
|
Subroutine
render: called CC=3 SCAR=11.2
Pod
undocumented
| |||||||||||||||||||||
| 23 | 3 | my ( $self, $result ) = @_; | |||||||||||||||||||
| 24 | 3 | ▶ | $result ||= $self->result; | ||||||||||||||||||
|
Condition66%2/3
$result ||= $self->result
MC/DC0%0/2
$result ||= $self->result
$result
$self->result
Truth table66%2/3
A ||= B
A= $resultB= $self->result
| |||||||||||||||||||||
| 25 | 3 | ▶ | die "No result for form field '" . $self->full_name . "'. Field may be inactive." unless $result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 26 | 3 | my $output = $self->render_element( $result ); | |||||||||||||||||||
| 27 | 3 | return $self->wrap_field( $result, $output ); | |||||||||||||||||||
| 28 | } | ||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 2 | 1; | |||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | __END__ | ||||||||||||||||||||