File Coverage

blib/lib/Data/MuForm/Field/Reset.pm
Criterion Covered Total %
statement 10 11 90.9
branch n/a
condition n/a
subroutine 4 5 80.0
pod 1 4 25.0
total 15 20 75.0


line stmt bran cond sub pod time code
1             package Data::MuForm::Field::Reset;
2             # ABSTRACT: reset field
3              
4 3     3   1969 use Moo;
  3         4  
  3         19  
5             extends 'Data::MuForm::Field';
6              
7              
8             has 'value' => ( is => 'rw', default => 'Reset' );
9             has '+no_update' => ( default => 1 );
10              
11 2     2 0 41 sub build_input_type { 'reset' }
12              
13 0     0 0 0 sub no_fif {1}
14 2     2 1 36 sub fif { shift->value }
15              
16             sub base_render_args {
17 2     2 0 43 my $self = shift;
18 2         10 my $args = $self->next::method(@_);
19 2         3 $args->{layout_type} = 'element';
20 2         5 $args->{wrapper} = 'none';
21 2         6 return $args;
22             }
23              
24             1;
25              
26             __END__
27              
28             =pod
29              
30             =encoding UTF-8
31              
32             =head1 NAME
33              
34             Data::MuForm::Field::Reset - reset field
35              
36             =head1 VERSION
37              
38             version 0.03
39              
40             =head1 SYNOPSIS
41              
42             Use this field to declare a reset field in your form.
43              
44             has_field 'reset' => ( type => 'Reset', value => 'Restore' );
45              
46             Uses the 'reset' widget.
47              
48             =head1 AUTHOR
49              
50             Gerda Shank
51              
52             =head1 COPYRIGHT AND LICENSE
53              
54             This software is copyright (c) 2017 by Gerda Shank.
55              
56             This is free software; you can redistribute it and/or modify it under
57             the same terms as the Perl 5 programming language system itself.
58              
59             =cut