BookDB::Controller::Book
See BookDB
Book Controller
Sets a template.
Handles displaying and validating the form Will save to the database on validation
Handles displaying and validating the form without Catalyst Will save to the database on validation You must either put values into your HTML: value="[% form.fif.title %]" or set up FillInForm. In your forms, "object_class" should be your Result class, instead of the Catalyst <model><source_name>.
sub form : Private { my ( $self, $c, $id ) = @_;
my $form = BookDB::Form::Book->new(item_id => $id, schema => $c->model('DB')->schema); # put form and template in stash $c->stash->{form} = $form; $c->stash->{template} = 'book/form.tt'; $c->forward('View::TT'); # update form $form->update_from_form( $c->req->parameters ); return unless $c->req->method eq 'POST' && $form->validated; # get the new book that was just created by the form my $new_book = $form->item; # redirect to list. $c->res->redirect($c->uri_for('list')); }
Forwards to list.
Destroys a row and forwards to list.
Display edit form
Lists books
Fetches a row and sets a template.
Gerda Shank
This library is free software . You can redistribute it and/or modify it under the same terms as perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
Expected text after =item, not a bullet
To install Form::Processor::Model::DBIC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Form::Processor::Model::DBIC
CPAN shell
perl -MCPAN -e shell install Form::Processor::Model::DBIC
For more information on module installation, please visit the detailed CPAN module installation guide.