NAME
Reaction::UI::Controller - Reaction Base Controller Class
SYNOPSIS
package MyApp::Controller::Foo;
use strict;
use warnings;
use parent 'Reaction::UI::Controller';
use aliased 'Reaction::UI::ViewPort';
sub foo: Chained('/base') Args(0) {
my ($self, $ctx) = @_;
$ctx->push_viewport(ViewPort,
layout => 'foo',
);
}
1;
DESCRIPTION
Base Reaction Controller class. Inherits from:
METHODS
push_viewport $vp_class, %args
Creates a new instance of the Reaction::UI::ViewPort class ($vp_class) using the rest of the arguments given (%args). Defaults of the action can be overridden by using the 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 Reaction::UI::Window's FocusStack in the stash, and also returned to the calling code.
Related items:
TODO: explain how next_action as a scalar gets converted to the redirect arrayref thing
pop_viewport
pop_viewport_to $vp
Call "pop_viewport" in Reaction::UI::FocusStack or "pop_viewport_to" in Reaction::UI::FocusStack on the $c->stash->{focus_stack}
.
redirect_to $c, $to, $captures, $args, $attrs
Construct a URI and redirect to it.
$to can be:
- The name of an action in the current controller.
- A Catalyst::Action instance.
- An arrayref of controller name and the name of an action in that controller.
$captures and $args default to the current requests $captures and $args if not supplied.
AUTHORS
See Reaction::Class for authors.
LICENSE
See Reaction::Class for the license.