1 package Reaction::UI::Widget::Field::Mutable::Boolean;
3 use Reaction::UI::WidgetClass;
5 use namespace::clean -except => [ qw(meta) ];
6 extends 'Reaction::UI::Widget::Field::Mutable';
10 after fragment widget {
11 arg 'field_type' => 'checkbox';
14 implements fragment is_checked {
15 if ($_{viewport}->value_string) {
16 render 'is_checked_yes';
18 render 'is_checked_no';
22 __PACKAGE__->meta->make_immutable;
31 Reaction::UI::Widget::Field::Mutable::Boolean - A mutable boolean field
35 Provides a widget to manipulate a boolean value. This is a subclass of
36 L<Reaction::UI::Widget::Field::Mutable>.
42 Will set the argument C<field_type> to C<checkbox>.
46 Will render the C<is_checked_yes> fragment if the viewport has a true C<value_string>
47 or C<is_checked_no> if it does not.
53 share/skin/base/layout/field/mutable/boolean.tt
55 This layout set extends the next C<field/mutable> layout set in the skin inheritance.
57 The following layouts are provided:
63 Renders the input element that will be the checkbox.
67 Sets the value element attribute to 1 and renders the C<is_checked> fragment afterwards.
71 Sets the C<checked> attribute of the input element to C<checked>.
81 See L<Reaction::Class> for authors.
85 See L<Reaction::Class> for the license.