|
NAMEReaction::UI::Controller::Role::GetCollection DESCRIPTIONProvides 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 );
}
ATTRIBUTESmodel_nameThe 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_nameThe name of the collection whithin the model that this Controller will be utilizing. METHODSget_collection $cReturns an instance of the collection this controller uses. SEE ALSO
AUTHORSSee Reaction::Class for authors. LICENSESee Reaction::Class for the license. POD ERRORSHey! The above document had some coding errors, which are explained below:
|