Justin Hunter > Reaction-0.002005 > Reaction::UI::Controller::Role::GetCollection

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::GetCollection

DESCRIPTION ^

Provides a get_collection method, which fetches an Collection object from a specified model.

SYNOPSYS ^

    package MyApp::Controller::Foo;

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

    with 'Reaction::UI::Controller::Role::GetCollection';

    __PACKAGE__->config( model_name => 'MyAppIM', collection_name => 'foos' );

    sub bar :Local {
      my($self, $c) = @_;
      my $obj = $self->get_collection($c)->find( $some_key );
    }

ATTRIBUTES ^

model_name

The name of the model this controller will use as it's data source. Should be a name that can be passed to $C->model

collection_name

The name of the collection whithin the model that this Controller will be utilizing.

METHODS ^

get_collection $c

Returns an instance of the collection this controller uses.

SEE ALSO ^

Reaction::UI::Controller
Reaction::UI::Controller::Role::Action::Simple
Reaction::UI::Controller::Role::Action::Object
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: