MuForm/Field/Button.pm untested

filter: Statementstmt 0.0% 0 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 26 SCAR 6.9
CC
1
Cov
0%
build_form_element
2.0
build_input_type
2.0
no_fif
2.0
CRAP 2.0
1 package Data::MuForm::Field::Button;
2 # ABSTRACT: Button field
3  
4 use Moo;
5 extends 'Data::MuForm::Field';
6  
7 has 'value' => ( is => 'rw', default => 'Save' );
8 has '+no_update' => ( default => 1 );
9  
10 sub build_form_element { 'button' }
11 sub build_input_type { 'button' }
12  
13 sub no_fif {1}
14 sub fif { shift->value }
15  
16 sub base_render_args {
17 my $self = shift;
18 my $args = $self->next::method(@_);
19 $args->{layout_type} = 'element';
20 $args->{wrapper} = 'none';
21 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::Button - Button field
35  
36 =head1 VERSION
37  
38 version 0.04
39  
40 =head1 AUTHOR
41  
42 Gerda Shank
43  
44 =head1 COPYRIGHT AND LICENSE
45  
46 This software is copyright (c) 2017 by Gerda Shank.
47  
48 This is free software; you can redistribute it and/or modify it under
49 the same terms as the Perl 5 programming language system itself.
50  
51 =cut