line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Form::Factory::Control::Checkbox; |
2
|
|
|
|
|
|
|
$Form::Factory::Control::Checkbox::VERSION = '0.022'; |
3
|
1
|
|
|
1
|
|
489
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
with qw( |
6
|
|
|
|
|
|
|
Form::Factory::Control |
7
|
|
|
|
|
|
|
Form::Factory::Control::Role::BooleanValue |
8
|
|
|
|
|
|
|
Form::Factory::Control::Role::Labeled |
9
|
|
|
|
|
|
|
); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# ABSTRACT: the checkbox control |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has '+value' => ( |
15
|
|
|
|
|
|
|
isa => 'Str', |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
has '+default_value' => ( |
19
|
|
|
|
|
|
|
isa => 'Str', |
20
|
|
|
|
|
|
|
lazy => 1, |
21
|
|
|
|
|
|
|
default => sub { shift->false_value }, |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
1
|
|
|
1
|
|
5140
|
use constant default_isa => 'Str'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
73
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__END__ |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=pod |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=encoding UTF-8 |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 NAME |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Form::Factory::Control::Checkbox - the checkbox control |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 VERSION |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
version 0.022 |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 SYNOPSIS |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
has_control yes_no_box => ( |
46
|
|
|
|
|
|
|
control => 'checkbox', |
47
|
|
|
|
|
|
|
options => { |
48
|
|
|
|
|
|
|
true_value => 'Yes', |
49
|
|
|
|
|
|
|
false_value => 'No', |
50
|
|
|
|
|
|
|
is_true => 1, |
51
|
|
|
|
|
|
|
}, |
52
|
|
|
|
|
|
|
); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 DESCRIPTION |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
This represents a toggle button, typically displayed as a checkbox. This control implements L<Form::Factory::Control>, L<Form::Factory::Control::Role::BooleanValue>, L<Form::Factory::Control::Role::Labeled>, L<Form::Factory::Control::Role::ScalarValue>. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 METHODS |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 default_isa |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Boolean values default to C<Bool>. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 AUTHOR |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Andrew Sterling Hanenkamp <hanenkamp@cpan.org> |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
This software is copyright (c) 2015 by Qubling Software LLC. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
73
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |