1 package Reaction::UI::Widget::Value::Image;
3 use Reaction::UI::WidgetClass;
5 use namespace::clean -except => [ qw(meta) ];
8 implements fragment image {
9 if($_{viewport}->value_string) {
10 arg uri => $_{viewport}->uri;
17 __PACKAGE__->meta->make_immutable;
21 Reaction::UI::Widget::Value::Image - An image tag or non-image alternative
25 This widget allows you to render an image container that uses different
26 fragments for available and non-available images.
28 =head1 FRAGMENTS AND LAYOUTS
32 Has only layout implementation. The widget fragment is inherited from
33 L<Reaction::UI::Widget>. The layout will simply render the
34 C<image> fragment. This fragment can be overwritten by your own layout to
35 render, for example, a frame around the image.
39 Is only implemented in the widget. If the viewport has a true value in
40 C<value_string>, the C<uri> argument will be set to the value of the C<uri>
41 attribute or method return value of the viewport, and the C<has_image>
42 fragment will be rendered.
44 If C<value_string> is false, the C<no_image> fragment will be rendered.
48 This is only implemented in the layout file. It contains just an image
49 tag and will be rendered when the viewport has a true C<value_string>.
53 This has only an empty implementation in the layout file. It will output
54 nothing and is called when then viewport has a false C<value_string>.
56 =head1 LAYOUT TEMPLATE
58 share/skin/base/layout/value/image.tt
62 See L<Reaction::Class> for authors.
66 See L<Reaction::Class> for the license.