aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI/Widget/DisplayField/Collection.pm
blob: bcac990247daeb047bad3d7e9c3590a50f0c2de0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package Reaction::UI::Widget::DisplayField::Collection;

use Reaction::UI::WidgetClass;

class Collection, which {
  fragment widget [ qw/label list/ ];
  fragment label  [ string { $_{viewport}->label } ];
  fragment list   [ item => over func('viewport', 'value_names') ];
  fragment item   [ string { $_ } ];
};

1;

__END__;


=head1 NAME

Reaction::UI::Widget::DisplayField::Collection

=head1 DESCRIPTION

=head1 FRAGMENTS

=head2 widget

renders C<label> and C<list> passing additional variable "viewport"

=head2 label

C<content> contains the viewport's label

=head2 list

renders fragment item over the viewport's C<value_names>

=head2 item

C<content> contains the value of the current item ($_ / $_{_})

=head1 AUTHORS

See L<Reaction::Class> for authors.

=head1 LICENSE

See L<Reaction::Class> for the license.

=cut