Reaction::UI::Controller::Role::GetCollection - Reaction::UI::Controller::Role::GetCollection documentation


Reaction documentation  | view source Contained in the Reaction distribution.

Index


NAME

Top

Reaction::UI::Controller::Role::GetCollection

DESCRIPTION

Top

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

SYNOPSYS

Top

    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

Top

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

Top

get_collection $c

Returns an instance of the collection this controller uses.

SEE ALSO

Top

AUTHORS

Top

See Reaction::Class for authors.

LICENSE

Top

See Reaction::Class for the license.


Reaction documentation  | view source Contained in the Reaction distribution.