6f5953236ec27bb466365470e76465cb836e25a6
[catagits/Reaction.git] / lib / Reaction / UI / Widget / Field / Collection.pm
1 package Reaction::UI::Widget::Field::Collection;
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
28 =head1 NAME
29
30 Reaction::UI::Widget::Field::Collection
31
32 =head1 DESCRIPTION
33
34 =head1 FRAGMENTS
35
36 =head2 widget
37
38 renders C<label> and C<list> passing additional variable "viewport"
39
40 =head2 label
41
42 C<content> contains the viewport's label
43
44 =head2 list
45
46 renders fragment item over the viewport's C<value_names>
47
48 =head2 item
49
50 C<content> contains the value of the current item ($_ / $_{_})
51
52 =head1 AUTHORS
53
54 See L<Reaction::Class> for authors.
55
56 =head1 LICENSE
57
58 See L<Reaction::Class> for the license.
59
60 =cut