MooseX::DFV - Data::FormValidator with Moose types and added sugar
use MooseX::DFV; use Moose::Util::TypeConstraints; my $person_prof = profile ( required => [qw/salary name/], constraints => { salary => { name => 'Salary', type => subtype as 'Int' => where { $_ > 10000 }, }, name => { name => 'Full name', type => 'Str', }, } ); my $params = { salary => '20000', name => 'Jim Bob'}; my $result = validate $params, against => $person_prof;
This module allows you to use Moose type constraints with
Declare a new DFV profile
my $profile = profile ( required=>[qw/field1 field2/], constraints => { field1 => {..} }, );
Validate parameters against a profile
my $result = validate $params, against => $profile_name;
Data::FormValidator Moose::Util::TypeConstraints MooseX::Types
git://github.com/robinedwards/MooseX-DFV.git
Rob Edwards, <robin.ge@gmail.com>
Copyright (C) 2010 by Rob Edwards
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install MooseX::DFV, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::DFV
CPAN shell
perl -MCPAN -e shell install MooseX::DFV
For more information on module installation, please visit the detailed CPAN module installation guide.