Justin Hunter > Reaction > Reaction::UI::Controller::Role::Action::Object

Download:
Reaction-0.002005.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  1
Stalled  1
View/Report Bugs
Source  

NAME ^

Reaction::UI::Controller::Role::Action::Object

DESCRIPTION ^

Provides an object action, which attempts to find an item in a collection and store it in the stash.

SYNOPSYS ^

    package MyApp::Controller::Foo;

    use base 'Reaction::Controller';
    use Reaction::Class;

    with(
      'Reaction::UI::Controller::Role::GetCollection',
      'Reaction::UI::Controller::Role::Action::Simple',
      'Reaction::UI::Controller::Role::Action::Object',
    );

    __PACKAGE__->config( action => {
      object => { Chained => 'base', PathPart => 'id' },
      foo_action => { Chained => 'object' },
    } );

    sub base :Chained('/base') :CaptureArgs(0) {
      ...
    }

    sub foo_action :Args(0){
      my($self, $c) = @_;
      $c->stash->{object}; #object is here....
    }

REQUIRED METHODS ^

The following methods must be provided by the consuming class:

get_collection

ACTIONS ^

object

Chain link, captures one argument. Attempts to find a single object by passing the captured argument to the find method of the collection returned by get_collection. If the object is found it is stored in the stash under the object key.

SEE ALSO ^

Reaction::UI::Controller
Reaction::UI::Controller::Role::GetCollection
Reaction::UI::Controller::Role::Action::Simple
Reaction::UI::Controller::Role::Action::List
Reaction::UI::Controller::Role::Action::View
Reaction::UI::Controller::Role::Action::Create
Reaction::UI::Controller::Role::Action::Update
Reaction::UI::Controller::Role::Action::Delete
Reaction::UI::Controller::Role::Action::DeleteAll

AUTHORS ^

See Reaction::Class for authors.

LICENSE ^

See Reaction::Class for the license.

syntax highlighting: