The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

App::Manoc::ControllerRole::ObjectList - Role for controllers accessing a list of results

VERSION

version 2.99.2

DESCRIPTION

This is a base role for Manoc controllers which manage a list of rows from a resultset.

ATTRIBUTES

object_list_filter_columns

object_list_options

Options for the DBIc search in get_object_list. Can be overridden by $c->stash->{object_list_options}.

ACTIONS

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}.

object_list

Populate object_list in stash using get_object_list method.

METHODS

get_object_list

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

SYNOPSYS

  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}
  }

AUTHORS

  • Gabriele Mambrini <gmambro@cpan.org>

  • Enrico Liguori

COPYRIGHT AND LICENSE

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.