X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FReaction%2FUI%2FController.pm;h=aa1b8bef045763d024567f503d0a3ba0abaab91f;hb=1ef7b9da7545471cbab981e32d42dee14267beb6;hp=361a5c24486abcaa0bc6f84a28698bb0bd8932f2;hpb=bd1aa0c203d4e2c70aeb2ced17ad023d2a27dd8f;p=catagits%2FReaction.git 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-Estash-E{focus_stack}>) and -return the instantiated viewport. +Creates a new instance of the L class +($vp_class) using the rest of the arguments given (%args). Defaults of +the action can be overridden by using the C 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's FocusStack in +the stash, and also returned to the calling code. + +Related items: + +=over + +=item L +=item L + +=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-Estash-E{focus_stack}>) +Call L or +L 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-Econtroller> not C<$self>). +Construct a URI and redirect to it. + +$to can be: + +=over -If C<$to> isa L -it will pass the argument directly to C<$c-Euri_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 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. 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