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 already record
 delete: delete record
 list:   retrieve all records

EXPORT

None by default.

METHODS

create

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

Read action.

update

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

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

List action.

INTERFACE METHODS

get_model($this,$c,$self,$id)

This method returns model object having $id. This method must be implemented by sub class.

get_models($this,$c,$self)

This method returns model objects. This method must be implemented by sub class.

SEE ALSO

Catalyst, Catalyst::Plugin::CRUD

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.