| 1 | package HTML::FormHandler::Widget::Field::Text; | ||||||||||||||||||||
| 2 | # ABSTRACT: text field rendering widget | ||||||||||||||||||||
| 3 | 136 | $HTML::FormHandler::Widget::Field::Text::VERSION = '0.410002'; | |||||||||||||||||||
| 4 | 136 | ▶ | use Moose::Role; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 136 | ▶ | use namespace::autoclean; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 136 | ▶ | use HTML::FormHandler::Render::Util ('process_attrs'); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 319 | ▶ | sub render_element { | ||||||||||||||||||
|
Subroutine
render_element: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||
| 10 | 319 | my $self = shift; | |||||||||||||||||||
| 11 | 319 | ▶ | my $result = shift || $self->result; | ||||||||||||||||||
|
Condition66%2/3
shift() || $self->result
MC/DC0%0/2
shift() || $self->result
shift()
$self->result
Truth table66%2/3
A || B
A= shift()B= $self->result
| |||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 319 | my $t; | |||||||||||||||||||
| 14 | 319 | my $rendered = $self->html_filter($result->fif); | |||||||||||||||||||
| 15 | 319 | my $output = '<input type="' . $self->input_type . '" name="' | |||||||||||||||||||
| 16 | . $self->html_name . '" id="' . $self->id . '"'; | ||||||||||||||||||||
| 17 | 319 | ▶ | $output .= qq{ size="$t"} if $t = $self->size; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 18 | 319 | ▶ | $output .= qq{ maxlength="$t"} if $t = $self->maxlength; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 19 | 319 | $output .= ' value="' . $self->html_filter($result->fif) . '"'; | |||||||||||||||||||
| 20 | 319 | $output .= process_attrs($self->element_attributes($result)); | |||||||||||||||||||
| 21 | 319 | $output .= ' />'; | |||||||||||||||||||
| 22 | 319 | return $output; | |||||||||||||||||||
| 23 | } | ||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | 317 | ▶ | sub render { | ||||||||||||||||||
|
Subroutine
render: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||
| 26 | 317 | my ( $self, $result ) = @_; | |||||||||||||||||||
| 27 | 317 | ▶ | $result ||= $self->result; | ||||||||||||||||||
|
Condition100%3/3
$result ||= $self->result
MC/DC100%2/2
$result ||= $self->result
$result
$self->result
Truth table100%3/3
A ||= B
A= $resultB= $self->result
| |||||||||||||||||||||
| 28 | 317 | ▶ | die "No result for form field '" . $self->full_name . "'. Field may be inactive." unless $result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 29 | 316 | my $output = $self->render_element( $result ); | |||||||||||||||||||
| 30 | 316 | return $self->wrap_field( $result, $output ); | |||||||||||||||||||
| 31 | } | ||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | 136 | 1; | |||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | __END__ | ||||||||||||||||||||