r23441@martha (orig r923): groditi | 2008-10-23 22:00:04 -0400
[catagits/Reaction.git] / lib / Reaction / UI / Widget / Field / Array.pm
1 package Reaction::UI::Widget::Field::Array;
2
3 use Reaction::UI::WidgetClass;
4
5 use namespace::clean -except => [ qw(meta) ];
6
7
8 before fragment widget {
9   arg 'label' => localized $_{viewport}->label;
10 };
11
12 implements fragment list {
13   render 'item' => over $_{viewport}->value_names;
14 };
15
16 implements fragment item {
17   arg 'name' => localized $_;
18 };
19
20 __PACKAGE__->meta->make_immutable;
21
22
23 1;
24
25 __END__;
26
27 =head1 NAME
28
29 Reaction::UI::Widget::DisplayField::Array
30
31 =head1 DESCRIPTION
32
33 =head1 FRAGMENTS
34
35 =head2 widget
36
37 renders C<label> and C<list> passing additional variable "viewport"
38
39 =head2 label
40
41 C<content> contains the viewport's label
42
43 =head2 list
44
45 renders fragment item over the viewport's C<value_names>
46
47 =head2 item
48
49 C<content> contains the value of the current item ($_ / $_{_})
50
51 =head1 AUTHORS
52
53 See L<Reaction::Class> for authors.
54
55 =head1 LICENSE
56
57 See L<Reaction::Class> for the license.
58
59 =cut