man Catalyst::Plugin::FormValidator () - FormValidator for Catalyst

NAME

Catalyst::Plugin::FormValidator - FormValidator for Catalyst

SYNOPSIS

    use Catalyst 'FormValidator';

    $c->form( optional => ['rest'] );
    print $c->form->valid('rest');

DESCRIPTION

This plugin uses Data::FormValidator 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.

EXTENDED METHODS

prepare

Sets up CW$c->{form} =cut

sub prepare { my CW$c = shift; CW$c = CW$c->NEXT::prepare(@_); CW$c->{form} = Data::FormValidator->check( CW$c->request->parameters, {} ); return CW$c; }

METHODS

form

Merge values with FormValidator.

    $c->form( required => ['yada'] );

Returns a Data::FormValidator::Results object.

    $c->form->valid('rest');

The actual parameters sent to CW$c->form are the same as used by Data::FormValidator's check function.

SEE ALSO

Catalyst, Data::FormValidator

AUTHOR

Sebastian Riedel, CWsri@cpan.org

COPYRIGHT

This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.