do not include .git directory
[catagits/Reaction.git] / lib / Reaction / UI / Widget / Value / Collection.pm
CommitLineData
e22de101 1package Reaction::UI::Widget::Value::Collection;
2
3use Reaction::UI::WidgetClass;
4
bae75bee 5use namespace::clean -except => [ qw(meta) ];
aa8c0c90 6
aa8c0c90 7
bae75bee 8before fragment widget {
d219104c 9 arg 'label' => localized $_{viewport}->label;
bae75bee 10};
aa8c0c90 11
bae75bee 12implements fragment list {
13 render 'item' => over $_{viewport}->value_names;
14};
aa8c0c90 15
bae75bee 16implements fragment item {
d219104c 17 arg 'name' => localized $_;
e22de101 18};
19
bae75bee 20__PACKAGE__->meta->make_immutable;
21
22
e22de101 231;
24
25__END__;
26
27
28=head1 NAME
29
30Reaction::UI::Widget::Value::Collection
31
32=head1 DESCRIPTION
33
f9b32c83 34This widget provides an additional C<label> argument for the C<widget>
35fragment containing the localised value of the viewports C<label> attribute.
36
37It also implements the fragments C<list> and C<item>.
38
39=head1 FRAGMENTS AND LAYOUTS
e22de101 40
41=head2 widget
42
f9b32c83 43This will set the C<label> argument to the return value of the C<label> method
44on the viewport. The base layout will then render the C<list> fragment.
e22de101 45
46=head2 list
47
f9b32c83 48This will render the C<item> fragment once for every entry in the viewports
49C<value_names>. The base layout will surround the rendered output with a unordered
50list.
e22de101 51
52=head2 item
53
f9b32c83 54This will set the argument C<name> to the localised value of the current iteration
55(stored in C<$_>). The base layout will render a list item with the value as
56html escaped content of the item.
57
58=head1 LAYOUT SETS
59
60 share/skin/base/layout/value/collection.tt
61 share/skin/base/layout/value/list.tt
e22de101 62
63=head1 AUTHORS
64
65See L<Reaction::Class> for authors.
66
67=head1 LICENSE
68
69See L<Reaction::Class> for the license.
70
71=cut