Reaction::UI::Controller::Role::GetCollection
Provides a get_collection method, which fetches an Collection object from a specified model.
get_collection
Collection
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 ); }
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
$C->model
The name of the collection whithin the model that this Controller will be utilizing.
Returns an instance of the collection this controller uses.
See Reaction::Class for authors.
See Reaction::Class for the license.
2 POD Errors
The following errors were encountered while parsing the POD:
Unknown directive: =over4
'=item' outside of any '=over'
To install Reaction, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Reaction
CPAN shell
perl -MCPAN -e shell install Reaction
For more information on module installation, please visit the detailed CPAN module installation guide.