| Catalyst-Plugin-CRUD documentation | view source | Contained in the Catalyst-Plugin-CRUD distribution. |
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 there is $c->stash->{create}->{error}, then it does not insert new recoed.
Triggers:
$self->call_trigger( 'create_check', $c, $hash ); $self->call_trigger( 'create_after', $c, $model );
Read action.
Update action.
If there is $c->stash->{update}->{error}, then it does not update already recoed.
Triggers:
$self->call_trigger( 'update_check', $c, $hash ); $self->call_trigger( 'update_after', $c, $model );
Delete action.
If there is $c->stash->{delete}->{error}, then it does not delete recoed.
Triggers:
$self->call_trigger( 'delete_check', $c, $model ); $self->call_trigger( 'delete_after', $c, $model );
List action.
This method returns model object having $id. This method must be implemented by sub class.
This method returns model objects. This method must be implemented by sub class.
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.
| Catalyst-Plugin-CRUD documentation | view source | Contained in the Catalyst-Plugin-CRUD distribution. |