aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI/Controller.pm
diff options
context:
space:
mode:
authorcastaway <castaway@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-08-17 15:51:43 +0000
committercastaway <castaway@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-08-17 15:51:43 +0000
commitf1cd5548dac21719deb3412fbc5d8dadb9338cc3 (patch)
treeac9450f31f8b6b6477cd8ad2c60e4ba5dd72eddc /lib/Reaction/UI/Controller.pm
parentd325256fd72c7a7c0af45e860f6d8d510b4682f2 (diff)
downloadreaction-f1cd5548dac21719deb3412fbc5d8dadb9338cc3.tar.gz
reaction-f1cd5548dac21719deb3412fbc5d8dadb9338cc3.zip
Much documentation updates
Diffstat (limited to 'lib/Reaction/UI/Controller.pm')
-rw-r--r--lib/Reaction/UI/Controller.pm55
1 files changed, 40 insertions, 15 deletions
diff --git a/lib/Reaction/UI/Controller.pm b/lib/Reaction/UI/Controller.pm
index 361a5c2..aa1b8be 100644
--- a/lib/Reaction/UI/Controller.pm
+++ b/lib/Reaction/UI/Controller.pm
@@ -97,11 +97,29 @@ Base Reaction Controller class. Inherits from:
=head2 push_viewport $vp_class, %args
-Will create a new instance of $vp_class with the arguments of %args
-merged in with any arguments in the ViewPort attribute of the current
-Catalyst action (also accessible through the controller config), add
-it to the main FocusStack (C<$c-E<gt>stash-E<gt>{focus_stack}>) and
-return the instantiated viewport.
+Creates a new instance of the L<Reaction::UI::ViewPort> class
+($vp_class) using the rest of the arguments given (%args). Defaults of
+the action can be overridden by using the C<ViewPort> key in the
+controller configuration. For example to override the default number
+of items in a CRUD list action:
+
+__PACKAGE__->config(
+ action => {
+ list => { ViewPort => { per_page => 50 } },
+ }
+ );
+
+The ViewPort is added to the L<Reaction::UI::Window>'s FocusStack in
+the stash, and also returned to the calling code.
+
+Related items:
+
+=over
+
+=item L<Reaction::UI::Controller::Root>
+=item L<Reaction::UI::Window>
+
+=back
TODO: explain how next_action as a scalar gets converted to the redirect arrayref thing
@@ -109,22 +127,29 @@ TODO: explain how next_action as a scalar gets converted to the redirect arrayre
=head2 pop_viewport_to $vp
-Shortcut to subs of the same name in the main FocusStack (C<$c-E<gt>stash-E<gt>{focus_stack}>)
+Call L<Reaction::UI::FocusStack/pop_viewport> or
+L<Reaction::UI::FocusStack/pop_viewport_to> on
+the C<< $c->stash->{focus_stack} >>.
=head2 redirect_to $c, $to, $captures, $args, $attrs
-If C<$to> is a string then redirects to the action of the same name in the current
- controller (C<$c-E<gt>controller> not C<$self>).
+Construct a URI and redirect to it.
+
+$to can be:
+
+=over
-If C<$to> isa L<Catalyst::Action>
-it will pass the argument directly to C<$c-E<gt>uri_for>.
+=item The name of an action in the current controller.
-If C<$to> is an ArrayRef with two items it will treat the first as a Controller name
-and the second as the action name whithin that controller.
+=item A L<Catalyst::Action> instance.
+
+=item An arrayref of controller name and the name of an action in that
+controller.
+
+=back
-C<$captures>, C<$args>, and C<$attrs> are equivalent to the same arguments in
-C<uri_for>. If left blank the current request captures and args will be used
-and C<$attrs> will be passed as an empty HashRef.
+$captures and $args default to the current requests $captures and
+$args if not supplied.
=head1 AUTHORS