Debian Codegraph @

lib/HTML/FormHandler/Field/Boolean.pm

raw
1 package HTML::FormHandler::Field::Boolean;
2 # ABSTRACT: a true or false field
3 $HTML::FormHandler::Field::Boolean::VERSION = '0.410002';
4 use Moose;
5 extends 'HTML::FormHandler::Field::Checkbox';
6
7
8 sub value {
9 my $self = shift;
10
11 my $v = $self->next::method(@_);
12
13 return $v ? 1 : 0;
14 }
15
16 __PACKAGE__->meta->make_immutable;
17 use namespace::autoclean;
18 1;
19
20 __END__
21
22 =pod
23
24 =encoding UTF-8
25
26 =head1 NAME
27
28 HTML::FormHandler::Field::Boolean - a true or false field
29
30 =head1 VERSION
31
32 version 0.410002
33
34 =head1 DESCRIPTION
35
36 This field returns 1 if true, 0 if false. The widget type is 'Checkbox'.
37 Similar to Checkbox, except only returns values of 1 or 0.
38
39 =head1 AUTHOR
40
41 FormHandler Contributors - see HTML::FormHandler
42
43 =head1 COPYRIGHT AND LICENSE
44
45 This software is copyright (c) 2017 by Gerda Shank.
46
47 This is free software; you can redistribute it and/or modify it under
48 the same terms as the Perl 5 programming language system itself.
49
50 =cut