search spec components factored out of T365
[catagits/Reaction.git] / lib / Reaction / UI / Widget / Collection.pm
1 package Reaction::UI::Widget::Collection;
2
3 use Reaction::UI::WidgetClass;
4
5 use namespace::clean -except => [ qw(meta) ];
6
7
8 implements fragment members {
9   render member => over $_{viewport}->members;
10 };
11
12 implements fragment member {
13   render 'viewport';
14 };
15
16 __PACKAGE__->meta->make_immutable;
17
18
19 1;
20
21 __END__;
22
23 =head1 NAME
24
25 Reaction::UI::Widget::Collection - Render the current viewport's member viewports
26
27 =head1 DESCRIPTION
28
29 This widget will allow you to render the viewports stored in the current viewports
30 C<members> attribute.
31
32 =head1 FRAGMENTS
33
34 =head2 members
35
36 Renders the C<member> fragment for every entry in the viewports C<members> attribute.
37
38 =head2 member
39
40 Renders the C<viewport> fragment, which will in turn render the C<_> argument. That
41 will be one of the viewports in the current viewport's C<members> attribute when
42 called from C<members>.
43
44 =head1 LAYOUT SETS
45
46   share/skin/base/layout/collection.tt
47
48 The following layouts are provided:
49
50 =over 4
51
52 =item widget
53
54 Renders a C<div> element with a class attribute of C<collection_members> and the
55 C<members> fragment as the content.
56
57 =back
58
59 =head1 SEE ALSO
60
61 =over 4
62
63 =item * L<Reaction::UI::Widget::Collection::Grid>
64
65 =item * L<Reaction::UI::ViewPort::Collection>
66
67 =back
68
69 =head1 AUTHORS
70
71 See L<Reaction::Class> for authors.
72
73 =head1 LICENSE
74
75 See L<Reaction::Class> for the license.
76
77 =cut