diff options
author | phaylon <phaylon@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-02-16 02:40:11 +0000 |
---|---|---|
committer | phaylon <phaylon@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2009-02-16 02:40:11 +0000 |
commit | f9b32c83550e273bec97c9be5b63079addd4846b (patch) | |
tree | c7bdd746379aa8bb3ffd1e2500d86daf32d3b8e0 /lib/Reaction/UI/WidgetClass.pm | |
parent | 63bb30b44346800078dc638dcc484828d89c2ad4 (diff) | |
download | reaction-f9b32c83550e273bec97c9be5b63079addd4846b.tar.gz reaction-f9b32c83550e273bec97c9be5b63079addd4846b.zip |
widget documentation
Diffstat (limited to 'lib/Reaction/UI/WidgetClass.pm')
-rw-r--r-- | lib/Reaction/UI/WidgetClass.pm | 90 |
1 files changed, 89 insertions, 1 deletions
diff --git a/lib/Reaction/UI/WidgetClass.pm b/lib/Reaction/UI/WidgetClass.pm index e68add0..f9c1b5a 100644 --- a/lib/Reaction/UI/WidgetClass.pm +++ b/lib/Reaction/UI/WidgetClass.pm @@ -132,10 +132,98 @@ __PACKAGE__->meta->make_immutable; =head1 NAME -Reaction::UI::WidgetClass +Reaction::UI::WidgetClass - Create a new widget class =head1 DESCRIPTION +Turns the importing package into a widget class. It will export: + +=over 4 + +=item All of L<Moose> + +=item All of L<Reaction::Class> + +=item L<strict> and L<warnings> + +=item See L</EXPORTS> for this package's own exports + +=back + +It will also set the value of C<default_base> as new superclass. The default is +C<Reaction::UI::Widget>. + +=head1 EXPORTS + +=head2 over + + over $collection + +Used in combination with L</render> to render a fragment for a series of values: + + render fragment_name => over [1, 2, 3]; + +=head2 render + + render $fragment_name; + render $fragment_name, $over; + +With only the fragment name as argument, it renders that fragment. If an C<$over> +collection is specified with the L</over> keyword, the fragment is rendered once +for every value in the collection. The value will be accessible in the topic +argument C<_>. + +=head2 arg + + arg $arg_name, $arg_value; + +Sets the fragment argument C<$arg_name> to C<$arg_value>; + +=head2 localized + + localize $value; + +Calls the view's C<localize> method to localize the passed value. + +=head2 call_next + + call_next; + +Calls the parent fragment. + +=head2 event_id + + event_id $event_name; + +Fetches the event id for the event C<$event_name> from the viewport via its C<event_id_for> +method. + +=head2 event_uri + + event_uri \%events; + +Returns an L<URI> object with the event ids corresponding to the keys in the C<%events> +argument and the values being the values of the hash reference. + +=head2 attrs + + attrs \%attrs; + +Builds a string of rendered element attributes out of the C<%attrs> hash reference argument. + +=head2 implements + + implements fragment foo { ... }; + implements bar => sub { ... }; + +Implements a method or a fragment in the widget class. + +=head2 fragment + + fragment foo { ... }; + +Creates a new fragment named C<foo> with a implementation in the block. + =head1 AUTHORS See L<Reaction::Class> for authors. |