Commit | Line | Data |
---|---|---|
2f670e13 | 1 | package Reaction::UI::Widget::Field::Collection; |
7b78a39d | 2 | |
3 | use Reaction::UI::WidgetClass; | |
4 | ||
5 | class Collection, which { | |
d7b00a50 | 6 | |
7 | before fragment widget { | |
8 | arg 'label' => $_{viewport}->label; | |
9 | }; | |
10 | ||
11 | implements fragment list { | |
12 | render 'item' => over $_{viewport}->value_names; | |
13 | }; | |
14 | ||
15 | implements fragment item { | |
16 | arg 'name' => $_; | |
17 | }; | |
18 | ||
7b78a39d | 19 | }; |
20 | ||
21 | 1; | |
22 | ||
23 | __END__; | |
24 | ||
7b78a39d | 25 | |
5a1a893e | 26 | =head1 NAME |
7b78a39d | 27 | |
2f670e13 | 28 | Reaction::UI::Widget::Field::Collection |
7b78a39d | 29 | |
5a1a893e | 30 | =head1 DESCRIPTION |
7b78a39d | 31 | |
5a1a893e | 32 | =head1 FRAGMENTS |
7b78a39d | 33 | |
5a1a893e | 34 | =head2 widget |
7b78a39d | 35 | |
5a1a893e | 36 | renders C<label> and C<list> passing additional variable "viewport" |
7b78a39d | 37 | |
5a1a893e | 38 | =head2 label |
39 | ||
40 | C<content> contains the viewport's label | |
41 | ||
42 | =head2 list | |
43 | ||
44 | renders fragment item over the viewport's C<value_names> | |
45 | ||
46 | =head2 item | |
47 | ||
48 | C<content> contains the value of the current item ($_ / $_{_}) | |
49 | ||
50 | =head1 AUTHORS | |
51 | ||
52 | See L<Reaction::Class> for authors. | |
53 | ||
54 | =head1 LICENSE | |
55 | ||
56 | See L<Reaction::Class> for the license. | |
7b78a39d | 57 | |
58 | =cut |