David Schmidt > CatalystX-Resource-0.003_002 > CatalystX::Resource::Controller::Resource

Download:
CatalystX-Resource-0.003_002.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.003_002   Source   Latest Release: CatalystX-Resource-0.02

NAME ^

CatalystX::Resource::Controller::Resource - Base Controller for Resources

VERSION ^

version 0.003_002

ATTRIBUTES ^

model

required, the DBIC model associated with this resource. (e.g.: 'DB::CDs')

identifier_candidates

ArrayRef of column names used as name in messages.

if you edit, delete, ... a resource a msg is stored in the stash. the first candidate available as accessor on the resoure (tested with $row->can(...)) that returns a defined value will be used.

example: "'Michael Jackson' has been deleted.", "'Artist (id: 3)' has been updated."

default: [ 'name', 'title' ]

if no identifier is found resource_key is used

resultset_key

stash key used to store the resultset of this resource. (e.g.: 'cds_rs')

resources_key

stash key used to store all results of this resource. (e.g.: 'tracks') You will need this to access a list of your resources in your template.

resource_key

stash key used to store specific result of this resource. (e.g.: 'track') You will need this to access your resource in your template.

parent_key

for a nested resource 'parent_key' is used as stash key to store the parent item (e.g.: 'cd') this is required if parent_key is set

parents_accessor

the accessor on the parent resource to get a resultset of this resource (accessor in DBIC has_many) (e.g.: 'tracks') this is required if parent_key is set

redirect_mode list|show|show_parent

After a created/edit/delete action a redirect takes place. The redirect behavior can be controlled with the redirect_mode attribute.

default = 'list'

error_path

documented in CatalystX::Resource

METHODS ^

_redirect

redirect request after create/edit/delete

_msg

returns notification msg to be displayed

_identifier

return an identifier for the resource

ACTIONS ^

the following actions will be loaded

base

Starts a chain and puts resultset into stash

For nested resources chain childrens 'base' action to parents 'base_with_id' action

base_with_id

chains to 'base' and puts resource with id into stash

AUTHOR ^

David Schmidt <davewood@cpan.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2011 by David Schmidt.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: