NAME
Data::FormValidator::Moose - DFV with Moose types and added sugar
VERSION 0.02
SYNOPSIS
use Data::FormValidator::Moose;
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;
DESCRIPTION
This module allows you to use Moose type constraints with
EXPORT
profile
Declare a new DFV profile
my $profile = profile ( required=>[qw/field1 field2/],
constraints => {
field1 => {..}
},
);
validate
Validate parameters against a profile
my $result = validate $params, against => $profile_name;
Returns a Data::FormValidator::Moose::Results object
SEE ALSO
Data::FormValidator Data::FormValidator::Results
Moose::Util::TypeConstraints MooseX::Types
REPOSITORY
git://github.com/robinedwards/Data-FormValidator-Moose.git
AUTHOR
Rob Edwards, <rge@cpan.org>
COPYRIGHT AND LICENSE
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.