
Reaction::UI::Controller

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

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
The name of the collection whithin the model that this Controller will be utilizing.
Read-write lazy building hashref.
The keys should match action names in the Controller and the value should be the ViewPort class that this action should use.
See method basic_page for more info.
Read-write lazy building hashref.
Additional ViewPort arguments for the action named as the key in the controller.
See method basic_page for more info.
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'
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.

Returns an instance of the collection this controller uses.
Provided builder for action_viewport_map.
Returns a hash containing:
list => 'Reaction::UI::ViewPort::Collection::Grid',
view => 'Reaction::UI::ViewPort::Object',
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{...} },
},
},
},
}
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.
Accepts two arguments, context, and a hashref of viewport arguments. It will automatically determine the action name using the catalyst stack and call push_viewport with the ViewPort class name contained in the action_viewport_map with a set of options determined by merging $vp_args and the arguments contained in action_viewport_args, if any.

Chain link, no-op.
Chain link, chained to base. list fetches the collection for the model and calls basic_page with a single argument, collection.
The default ViewPort for this action is Reaction::UI::ViewPort::ListView and can be changed by altering the action_viewport_map attribute hash.
Chain link, chained to base, captures one argument, 'id'. Attempts to find a single object by searching for a member of the current collection which has a Primary Key or Unique constraint matching that argument. If the object is found it is stored in the stash under the object key.
Chain link, chained to object. Calls basic page with one argument, model, which contains an instance of the object fetched by the object action link.
The default ViewPort for this action is Reaction::UI::ViewPort::Object and can be changed by altering the action_viewport_map attribute hash.


See Reaction::Class for authors.

See Reaction::Class for the license.