Catalyst::Controller::CRUD - CRUD (create/read/update/delete) Controller for Catalyst
package MyApp::Controller::Foo; use base qw(Catalyst::Controller); use Catalyst::Controller::CRUD::CDBI; sub create : Local { my ($self, $c) = @_; Catalyst::Controller::CRUD::CDBI->create($c, $self); } 1;
This module provides CRUD (create/read/update/delete) action.
create: insert new record read: retrieve record update: update already record delete: delete record list: retrieve all records
None by default.
create action.
if $c->stash->{create}->{error}, then do not insert new recoed.
triggers:
$self->call_trigger( 'input_before', $c ); $self->call_trigger( 'create_check', $c, $hash ); $self->call_trigger( 'create_after', $c, $model );
read action.
update action.
if $c->stash->{update}->{error}, then do not update already recoed.
$self->call_trigger( 'input_before', $c ); $self->call_trigger( 'update_check', $c, $model ); $self->call_trigger( 'update_after', $c, $model );
delete action.
if $c->stash->{delete}->{error}, then do not delete recoed.
$self->call_trigger( 'delete_check', $c, $model ); $self->call_trigger( 'delete_after', $c, $model );
list action.
translate model object to hash reference. this method must be implemented by sub class.
return model from $id. this method must be implemented by sub class.
return all models. this method must be implemented by sub class.
insert new record.
prepare for /xxx/create/yyy.
update already record.
Catalyst, Catalyst::Plugin::CRUD
Jun Shimizu, <bayside@cpan.org>
Copyright (C) 2006,2007 by Jun Shimizu
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.2 or, at your option, any later version of Perl 5 you may have available.
To install Catalyst::Plugin::CRUD, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Plugin::CRUD
CPAN shell
perl -MCPAN -e shell install Catalyst::Plugin::CRUD
For more information on module installation, please visit the detailed CPAN module installation guide.