NAME
BookDB::Controller::Book
SYNOPSIS
See BookDB
DESCRIPTION
Book Controller
METHODS
- add
-
Sets a template.
- form
-
Handles displaying and validating the form Will save to the database on validation
- form (without Catalyst plugin)
-
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')); }
- default
-
Forwards to list.
- destroy
-
Destroys a row and forwards to list.
- edit
-
Display edit form
- list
-
Lists books
- view
-
Fetches a row and sets a template.
- do_return
AUTHOR
Gerda Shank
LICENSE
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:
- Around line 189:
Expected text after =item, not a bullet