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