Object consumes Action and Collection consumes Pager and Action, so Member::WithActio...
[catagits/Reaction.git] / lib / Reaction / UI / Widget / Field / Image.pm
CommitLineData
ddd1dc65 1package Reaction::UI::Widget::Field::Image;
2
3use Reaction::UI::WidgetClass;
4
bae75bee 5use namespace::clean -except => [ qw(meta) ];
6extends 'Reaction::UI::Widget::Field';
ddd1dc65 7
bae75bee 8
9
10implements fragment image {
11 if($_{viewport}->value_string) {
12 arg uri => $_{viewport}->uri;
13 render 'has_image';
14 } else {
15 render 'no_image';
16 }
ddd1dc65 17};
18
bae75bee 19__PACKAGE__->meta->make_immutable;
20
ddd1dc65 211;
f9b32c83 22
23__END__
24
25=head1 NAME
26
27Reaction::UI::Widget::Field::Image - An image field
28
29=head1 DESCRIPTION
30
31This L<Reaction::UI::Widget::Field> widget represents an image.
32
33=head1 FRAGMENTS
34
35=head2 image
36
37If the viewport's C<value_string> is true, it will render the C<has_image>
38fragment after setting the C<uri> argument to the value of the viewport's
39C<uri>.
40
41If the C<value_string> is false the C<no_image> fragment will be rendered.
42
43=head1 SEE ALSO
44
45=over 4
46
47=item * L<Reaction::UI::Widget::Field>
48
49=item * L<Reaction::UI::Widget::Value::Image>
50
51=back
52
53=head1 AUTHORS
54
55See L<Reaction::Class> for authors.
56
57=head1 LICENSE
58
59See L<Reaction::Class> for the license.
60
61=cut