NAME
Catalyst::Model::CDBI::CRUD - CRUD CDBI Model Class
SYNOPSIS
# lib/MyApp/Model/CDBI.pm
package MyApp::Model::CDBI;
use base 'Catalyst::Model::CDBI::CRUD';
__PACKAGE__->config(
dsn => 'dbi:SQLite2:/tmp/myapp.db',
relationships => 1
);
1;
# lib/MyApp.pm
package MyApp;
use Catalyst 'FormValidator';
__PACKAGE__->config(
name => 'My Application',
root => '/home/joeuser/myapp/root'
);
__PACKAGE__->action(
'table' => sub {
my ( $self, $c ) = @_;
$c->form( optional => [ MyApp::Model::CDBI::Table->columns ] );
$c->forward('MyApp::Model::CDBI::Table');
}
);
1;
DESCRIPTION
This is a subclass of Catalyst::Model::CDBI
with additional CRUD methods. Don't forget to copy the base templates to config->root!
METHODS
add
Does nothing by default.
destroy
Deletes a Class::DBI object.
do_add
Creates a new Class::DBI object from $c->form.
do_edit
Updates a Class::DBI object from $c->form.
edit
Does nothing by default.
list
Does nothing by default.
process
Dispatches CRUD request to methods.
view
Does nothing by default.
SEE ALSO
Catalyst, Catalyst::Model::CDBI
AUTHOR
Sebastian Riedel, sri@cpan.org
COPYRIGHT
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.