GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  REACTION::UI::CONTROLLER (3)

.ds Aq ’

NAME

Reaction::UI::Controller - Reaction Base Controller Class

CONTENTS

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, subclass of Catalyst::Controller.

ROLES CONSUMED

Catalyst::Component::InstancePerContext
Reaction::UI::Controller::Role::RedirectTo Please not that this functionality is now deprecated.

METHODS

push_viewport CW$vp_class, CW%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:
Reaction::UI::Controller::Root =item Reaction::UI::Window
TODO: explain how next_action as a scalar gets converted to the redirect arrayref thing

    pop_viewport

pop_viewport_to CW$vp

Call pop_viewport in Reaction::UI::FocusStack or pop_viewport_to in Reaction::UI::FocusStack on the $c->stash->{focus_stack}.

redirect_to CW$c, CW$to, CW$captures, CW$args, CW$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.

    make_context_closure

The purpose of this method is to prevent memory leaks. It weakens the context object, often denoted $c, and passes it as the first argument to the sub{} that is passed to the make_context_closure method. In other words,

make_context_closure returns sub { $sub_you_gave_it->($weak_c, @_)

To further expound up this useful construct consider code written before make_context_closure was created:



    on_apply_callback =>
        sub {
          $self->after_search( $c, @_ );
        }
    ),



This could be rewritten as:



    on_apply_callback => $self->make_context_closure(
        sub {
            my $weak_c = shift;
            $self->after_search( $weak_c, @_ );
        }
    ),



Or even more succintly:



    on_apply_callback => $self->make_context_closure(
        sub {
            $self->after_search( @_ );
        }
    ),



AUTHORS

See Reaction::Class for authors.

LICENSE

See Reaction::Class for the license.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 REACTION::UI::CONTROLLER (3) 2010-10-29

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.