aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI/Widget/Value.pm
blob: eb83c391d36886cb4072b7ce452c29bc67ed7f9f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package Reaction::UI::Widget::Value;

use Reaction::UI::WidgetClass;

use namespace::clean -except => [ qw(meta) ];


before fragment widget {
  if ($_{viewport}->can('value_string')) {
    arg value => $_{viewport}->value_string;
  } elsif($_{viewport}->can('value')) {
    arg value => $_{viewport}->value;
  }
};

__PACKAGE__->meta->make_immutable;


1;

__END__;

=head1 NAME

Reaction::UI::Widget::Value

=head1 DESCRIPTION

This widget provides the return value of the C<vlues_string> or C<value>
method on the viewport (depending on which is available first) via the
C<value> argument to widget.

=head1 INCLUDED SUBCLASSES

=over

=item L<Reaction::UI::Widget::Value::Boolean>

Will simply display the C<value>.

=item L<Reaction::UI::Widget::Value::Collection>

This widget iterates over a collection of values provided by the viewport
and renders an unordered list out of them.

=item L<Reaction::UI::Widget::Value::DateTime>

A simple subclass of L<Reaction::UI::Widget::Value>, currently not doing
much.

=item L<Reaction::UI::Widget::Value::Image>

Provides C<has_image> and C<no_image> blocks that will be rendered depending
on the viewports C<value_string> attribute. The defaults are to either render
an image tag, or to output nothing at all.

=item L<Reaction::UI::Widget::Value::Number>

A simple subclass of C<Reaction::UI::Widget::Value> that doesn't do much yet.

=item L<Reaction::UI::Widget::Value::RelatedObject>

A simple subclass of C<Reaction::UI::Widget::Value> that doesn't do much yet.

=item L<Reaction::UI::Widget::Value::String>

A simple subclass of C<Reaction::UI::Widget::Value> that doesn't do much yet.

=item L<Reaction::UI::Widget::Value::Text>

A simple subclass of C<Reaction::UI::Widget::Value> that doesn't do much yet.

=back

=head1 FRAGMENTS

=head2 widget

Additional available arguments

=over 4

=item B<value> - The C<value_string> or C<value> of the viewport

=back

=head1 AUTHORS

See L<Reaction::Class> for authors.

=head1 LICENSE

See L<Reaction::Class> for the license.

=cut