NAME
Catalyst::Controller::CRUD - CRUD (create/read/update/delete) Controller for Catalyst
SYNOPSIS
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;
DESCRIPTION
This module provides CRUD (create/read/update/delete) action.
create: insert new record
read: retrieve record
update: update record
delete: delete record
list: retrieve all records
EXPORT
None by default.
METHODS
create
create action.
if $c->stash->{create}->{error} is 1, then do not insert new recoed.
triggers:
$self->call_trigger( 'input_before', $c );
$self->call_trigger( 'create_before', $c, $hash );
$self->call_trigger( 'create_after', $c, $model );
read
read action.
triggers:
$self->call_trigger( 'read_before', $c );
update
update action.
if $c->stash->{update}->{error} is 1, then do not update recoed.
triggers:
$self->call_trigger( 'input_before', $c );
$self->call_trigger( 'update_before', $c, $model );
$self->call_trigger( 'update_after', $c, $model );
delete
delete action.
if $c->stash->{delete}->{error} is 1, then do not delete recoed.
triggers:
$self->call_trigger( 'delete_before', $c, $model );
$self->call_trigger( 'delete_after', $c );
list
list action
triggers:
$self->call_trigger( 'list_before', $c );
INTERNAL METHODS
model_to_hashref($this,$model)
translate model object to hash reference
get_model($this,$c,$self,$id)
return model from $id. this method is implemented by sub class.
get_models($this,$c,$self)
return all models. this method is implemented by sub class.
SEE ALSO
Catalyst
AUTHOR
Jun Shimizu, <bayside@cpan.org>
COPYRIGHT AND LICENSE
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.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 266:
=cut found outside a pod block. Skipping to next block.