| 1 | package HTML::FormHandler::Widget::Field::ButtonTag; | ||||||||||||||||||||
| 2 | # ABSTRACT: button field rendering widget, using button tag | ||||||||||||||||||||
| 3 | 6 | $HTML::FormHandler::Widget::Field::ButtonTag::VERSION = '0.410002'; | |||||||||||||||||||
| 4 | 6 | ▶ | use Moose::Role; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 6 | ▶ | use namespace::autoclean; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 6 | ▶ | use HTML::FormHandler::Render::Util ('process_attrs'); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 0 | ▶ | sub html_element { 'button' } | ||||||||||||||||||
|
Subroutine
html_element: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 9 | |||||||||||||||||||||
| 10 | 13 | ▶ | sub render_element { | ||||||||||||||||||
|
Subroutine
render_element: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||
| 11 | 13 | my ( $self, $result ) = @_; | |||||||||||||||||||
| 12 | 13 | ▶ | $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
| |||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 13 | my $output = '<button type="' . $self->input_type . '" name="' | |||||||||||||||||||
| 15 | . $self->html_name . '" id="' . $self->id . '"'; | ||||||||||||||||||||
| 16 | 13 | $output .= process_attrs($self->element_attributes($result)); | |||||||||||||||||||
| 17 | 13 | $output .= '>'; | |||||||||||||||||||
| 18 | 13 | $output .= $self->_localize($self->value); | |||||||||||||||||||
| 19 | 13 | $output .= "</button>"; | |||||||||||||||||||
| 20 | 13 | return $output; | |||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 13 | ▶ | sub render { | ||||||||||||||||||
|
Subroutine
render: called CC=3 SCAR=11.8
Pod
undocumented
| |||||||||||||||||||||
| 24 | 13 | my ( $self, $result ) = @_; | |||||||||||||||||||
| 25 | 13 | ▶ | $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
| |||||||||||||||||||||
| 26 | 13 | ▶ | die "No result for form field '" . $self->full_name . "'. Field may be inactive." unless $result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 27 | 13 | my $output = $self->render_element( $result ); | |||||||||||||||||||
| 28 | 13 | return $self->wrap_field( $result, $output ); | |||||||||||||||||||
| 29 | } | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | 6 | 1; | |||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | __END__ | ||||||||||||||||||||