Validator::Custom

Validate user input easily
Download

Validator::Custom Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Yuki Kimoto
  • Publisher web site:
  • http://search.cpan.org/~kimoto/

Validator::Custom Tags


Validator::Custom Description

Validator::Custom is a Perl module to validate user input easily. The features are the following ones.- Many constraint functions are available by default, such as not_blank, int, defined, in_array, length.- Several filter functions are available by default, such as trim, datetime_to_timepiece, date_to_timepiece.- You can register your constraint function.- You can set error messages for invalid parameter value. The order of messages is keeped.- Support OR condtion constraint, Negativate constraint.SYNOPSYS use Validator::Custom; my $vc = Validator::Custom->new; my $data = {age => 19, name => 'Ken Suzuki'}; my $rule = , name => {message => 'name must be string. the length 1 to 5'} => } ], price => ]; my $result = $vc->validate($data, $rule); unless ($result->is_ok) { if ($result->has_missing) { my $missing_params = $result->missing_params; } if ($result->has_invalid) { my $messages = $result->messages_to_hash; } } my $valid_data = $result->data; my $raw_data = $result->raw_data; my $loose_data = $result->loose_data;Product's homepage


Validator::Custom Related Software