| 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 |