App::Manoc::ControllerRole::ObjectList - Role for controllers accessing a list of results
version 2.99.2
This is a base role for Manoc controllers which manage a list of rows from a resultset.
Options for the DBIc search in get_object_list. Can be overridden by $c->stash->{object_list_options}.
get_object_list
Load the list of objects from the resultset into the stash. Chained to base. This is the point for chaining all actions using the list of object.
Objects are fetched by get_object_list and stored in $c->stash->{object_list}.
Populate object_list in stash using get_object_list method.
Search in $c->stash->{resultset} using the filter returned by get_object_list_filter and the options in $c->stash->{object_list_options} or object_list_options.
get_object_list_filter
package App::Manoc::Controller::Artist; use Moose; extends "Catalyst::Controller"; with "App::Manoc::ControllerRole::Object"; __PACKAGE__->config( # define PathPart action => { setup => { PathPart => 'artist', } }, class => 'ManocDB::Artist', ); # manages /artist/ sub list : Chained('object_list') : PathPart('') : Args(0) { my ( $self, $c ) = @_; # render with default template # objects are stored in $c->{object_list} }
Gabriele Mambrini <gmambro@cpan.org>
Enrico Liguori
This software is copyright (c) 2017 by Gabriele Mambrini.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install App::Manoc, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Manoc
CPAN shell
perl -MCPAN -e shell install App::Manoc
For more information on module installation, please visit the detailed CPAN module installation guide.