Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #CNG::Controller::Form::Booking
- has "form" => (
- is => 'rw', isa => 'CNG::HTML::FormHandler::Form::Booking',
- lazy => 1,
- builder => '_build_form',
- );
- sub _build_form {
- my $self = shift;
- return CNG::HTML::FormHandler::Form::Booking->new( );
- }
- sub get_form {
- my $self = shift;
- my $action = shift;
- $self->form->clear;
- $self->form->action($action) if $action;
- return $self->form;
- }
- sub start :Chained('base') :PathPart('booking') :Args(0) : GET {
- my ($self, $c) = @_;
- (my $form = $self->get_form())->process( schema => $c->model('DBIC')->schema );
- $c->stash(
- template => $self->templates->{create},
- form => $form,
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement