| Reaction documentation | Contained in the Reaction distribution. |
Reaction::UI::Widget::Field - A simple labelled text field
This widget renders a simple labelled text field.
Sets the field_value argument either to the result of the value_string
method on the viewport, or to an empty string if the viewport does not support
the method.
Will set the label argument to the localised value of the viewport's label
method and render the label fragment if the viewport's label value
is true.
share/skin/base/layout/field.tt
The following layouts are provided:
Renders the label_fragment and value_layout fragments.
Renders a span element with a field_label class attribute containing the
label argument and a double colon.
Renders a span element with a field_value class attribute containing the
field_value argument.
share/skin/default/layout/field.tt
This layout set inherits from the NEXT one in the skin inheritance.
The following layouts are provided:
The same as in the base skin except that the label argument is surrounded
by a strong element.
For mutable fields see Reaction::UI::Widget::Field::Mutable.
A simple text subclass of Reaction::UI::Field.
A simple string subclass of Reaction::UI::Field.
A simple subclass of Reaction::UI::Field.
A simple number subclass of Reaction::UI::Field.
A simple integer subclass of Reaction::UI::Field.
A field representing an optional image.
A simple DateTime subclass of Reaction::UI::Field.
A container field for multiple values.
A field containing a collection of localised values.
A simple boolean subclass of Reaction::UI::Field.
A field representing an array of values, like Reaction::UI::Field::Collection.
See Reaction::Class for authors.
See Reaction::Class for the license.
| Reaction documentation | Contained in the Reaction distribution. |
package Reaction::UI::Widget::Field; use Reaction::UI::WidgetClass; use namespace::clean -except => [ qw(meta) ]; before fragment widget { if ($_{viewport}->can('value_string')) { arg 'field_value' => $_{viewport}->value_string; } else { arg 'field_value' => ''; #$_{viewport}->value; } }; implements fragment label_fragment { if (my $label = $_{viewport}->label) { arg label => localized $label; render 'label'; } }; __PACKAGE__->meta->make_immutable; 1; __END__;