97c1803c4ce437087bb57a7021c5a7d58fdcec4b
[catagits/Reaction.git] / lib / Reaction / UI / Widget / Field / Mutable / Boolean.pm
1 package Reaction::UI::Widget::Field::Mutable::Boolean;
2
3 use Reaction::UI::WidgetClass;
4
5 use namespace::clean -except => [ qw(meta) ];
6 extends 'Reaction::UI::Widget::Field::Mutable';
7
8
9
10 after fragment widget {
11    arg 'field_type' => 'checkbox';
12 };
13
14 implements fragment is_checked {
15   if ($_{viewport}->value_string) {
16     render 'is_checked_yes';
17   } else {
18     render 'is_checked_no';
19   }
20 };
21
22 __PACKAGE__->meta->make_immutable;
23
24
25 1;
26
27 __END__;
28
29 =head1 NAME
30
31 Reaction::UI::Widget::Field::Boolean
32
33 =head1 DESCRIPTION
34
35 See L<Reaction::UI::Widget::Field>
36
37 =head1 AUTHORS
38
39 See L<Reaction::Class> for authors.
40
41 =head1 LICENSE
42
43 See L<Reaction::Class> for the license.
44
45 =cut