Reaction::UI::Controller::Collection - Reaction::UI::Controller::Collection documentation


Reaction documentation  | view source Contained in the Reaction distribution.

Index


NAME

Top

Reaction::UI::Controller::Collection

DESCRIPTION

Top

Controller class used to make displaying collections easier. Inherits from Reaction::UI::Controller.

ROLES CONSUMED

Top

This role also consumes the following roles:

ATTRIBUTES

Top

default_member_actions

Read-write lazy building arrayref. The names of the member actions (the actions that apply to each member of the collection and typically have an object as a target e.g. update,delete) to be enabled by default. By default, this is only 'view'

default_collection_actions

Read-write lazy building arrayref. The names of the collection actions (the actions that apply to the entire collection and typically have a collection as a target e.g. create, delete_all) to be enabled by default. By default, this is only empty.

METHODS

Top

_build_action_viewport_map

Set list to Reaction::UI::ViewPort::Collection::Grid

_build_action_viewport_args

By default will reurn a hashref containing action prototypes for all default member and collection actions. The prototype URI generators are generated by _build_member_action_prototype and _build_collection_action_prototype respectively and labels are the result of replacing underscores in the name with spaces and capitalizing the first letter. If you plan to use custom actions that are not supported by this scheme or you would like to customize the values it is suggested you wrap / override this method.

Default output for a controller having only 'view' enabled:

    { list => {
        action_prototypes => {},
        Member => {
          action_prototypes => {
            view => {label => 'View', uri => sub{...} },
          },
        },
      },
    }

_build_member_action_prototype $label, $action_name

Creates an action prototype suitable for creating action links in Reaction::UI::ViewPort::Role::Actions. $action_name should be the name of a Catalyst action in this controller.The prototype will generate a URI based on the action, current captures.

_build_collection_action_prototype $label, $action_name

basic_page $c, \%vp_args

Deprecated alias to setup_viewport.

ACTIONS

Top

base

Chain link, no-op.

list

Chained to base. See Reaction::UI::Controller::Role::Action::List

object

Chained to base. See Reaction::UI::Controller::Role::Action::Object

view

Chained to object. See Reaction::UI::Controller::Role::Action::View

SEE ALSO

Top

Reaction::UI::Controller

AUTHORS

Top

See Reaction::Class for authors.

LICENSE

Top

See Reaction::Class for the license.


Reaction documentation  | view source Contained in the Reaction distribution.