| 1 | package HTML::FormHandler::Widget::Field::Reset; | ||||||||||||||||||||
| 2 | # ABSTRACT: reset field rendering widget | ||||||||||||||||||||
| 3 | 3 | $HTML::FormHandler::Widget::Field::Reset::VERSION = '0.410001'; | |||||||||||||||||||
| 4 | 3 | ▶ | use Moose::Role; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 3 | ▶ | use namespace::autoclean; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 3 | ▶ | use HTML::FormHandler::Render::Util ('process_attrs'); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | sub render_element { | ||||||||||||||||||||
| 10 | 5 | ▶ | my ( $self, $result ) = @_; | ||||||||||||||||||
|
Subroutine
render_element: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||
| 11 | 5 | ▶ | $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 | 5 | my $output = '<input type="reset" name="'; | |||||||||||||||||||
| 14 | 5 | $output .= $self->html_name . '"'; | |||||||||||||||||||
| 15 | 5 | $output .= ' id="' . $self->id . '"'; | |||||||||||||||||||
| 16 | 5 | $output .= ' value="' . $self->html_filter($self->_localize($self->value)) . '"'; | |||||||||||||||||||
| 17 | 5 | $output .= process_attrs($self->element_attributes($result)); | |||||||||||||||||||
| 18 | 5 | $output .= ' />'; | |||||||||||||||||||
| 19 | 5 | return $output; | |||||||||||||||||||
| 20 | } | ||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | sub render { | ||||||||||||||||||||
| 23 | 5 | ▶ | my ( $self, $result ) = @_; | ||||||||||||||||||
|
Subroutine
render: called CC=3 SCAR=11.2
Pod
undocumented
| |||||||||||||||||||||
| 24 | 5 | ▶ | $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 | 5 | ▶ | die "No result for form field '" . $self->full_name . "'. Field may be inactive." unless $result; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 26 | 5 | my $output = $self->render_element( $result ); | |||||||||||||||||||
| 27 | 5 | return $self->wrap_field( $result, $output ); | |||||||||||||||||||
| 28 | } | ||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 3 | 1; | |||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | __END__ | ||||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | =pod | ||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | =encoding UTF-8 | ||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | =head1 NAME | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | HTML::FormHandler::Widget::Field::Reset - reset field rendering widget | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | =head1 VERSION | ||||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | version 0.410001 | ||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | =head1 SYNOPSIS | ||||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | Renders a reset field | ||||||||||||||||||||
| 49 | |||||||||||||||||||||
| 50 | =head1 AUTHOR | ||||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | FormHandler Contributors - see HTML::FormHandler | ||||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | This software is copyright (c) 2017 by Gerda Shank. | ||||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||
| 59 | the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||
| 60 | |||||||||||||||||||||
| 61 | =cut | ||||||||||||||||||||