Catalyst::Plugin::FormValidator - FormValidator for Catalyst |
Catalyst::Plugin::FormValidator - FormValidator for Catalyst
use Catalyst 'FormValidator';
$c->form( optional => ['rest'] ); print $c->form->valid('rest');
This plugin uses the Data::FormValidator manpage to validate and set up form data from your request parameters. It's a quite thin wrapper around that module, so most of the relevant information can be found there.
Sets up $c->{form} =cut
sub prepare { my $c = shift; $c = $c->NEXT::prepare(@_); $c->{form} = Data::FormValidator->check( $c->request->parameters, {} ); return $c; }
Merge values with FormValidator.
$c->form( required => ['yada'] );
Returns a the Data::FormValidator::Results manpage object.
$c->form->valid('rest');
The actual parameters sent to $c->form are the same as used by the Data::FormValidator manpage's check function.
Catalyst, the Data::FormValidator manpage
Sebastian Riedel, sri@cpan.org
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
Catalyst::Plugin::FormValidator - FormValidator for Catalyst |