Catalyst::Controller::FormValidator - check form data
Form-validation using a Catalyst controller and Data::FormValidator
use base 'Catalyst::Controller::FormValidator'; use Data::FormValidator::Constraints qw(:closures); # define a DFV profile my $dfv_profile = { required => [qw< email_address phone_home phone_mobile >], constraint_methods => { email_address => email(), phone_home => american_phone(), phone_mobile => american_phone(), }, }; # check the form for errors $c->forward('form_check', [$dfv_profile]); # perform custom/complex checking and # add to form validation failures if (not is_complex_test_ok()) { $c->forward( 'add_form_invalid', [ $error_key, $error_constraint_name ] ); }
Chisel Wright
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
To install Parley, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Parley
CPAN shell
perl -MCPAN -e shell install Parley
For more information on module installation, please visit the detailed CPAN module installation guide.