GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Validator::Custom::Validation(3) User Contributed Perl Documentation Validator::Custom::Validation(3)

Validator::Custom::Validation - a result of validation

  my $validation = $vc->validation;
  
  $validation->add_failed(title => 'title is invalid');
  $validation->add_failed(name => 'name is invalid');
  
  # Is valid
  my $is_valid = $validation->is_valid;
  my $title_is_valid = $validation->is_valid('title');
  
  # Get all failed parameter names
  my $failed = $validation->failed;
  
  # Message
  my $messages = $validation->messages;
  my $title_message = $validation->message('title');
  my $messages_h = $validation->messages_to_hash;

Validator::Custom::Validation inherits all methods from Object::Simple and implements the following new ones.

  my $validation = Validator::Custom::Validation->new;

Create a Validator::Custom::Validation object.

Generally this method is not used. You should use "validation" method of Validator::Custom.

  my $validation = $vc->validation;

  my $is_valid = $validation->is_valid;
  my $is_valid = $validation->is_valid('title');

Check if the result of validation is valid. If name is specified, check if the parameter corresponding to the name is valid.

  $validation->add_failed('title' => 'title is invalid value');
  $validation->add_failed('title');

Add a failed parameter name and message. If message is omitted, default message is set automatically.

  my $failed = $validation->failed;

Get all failed parameter names.

  my $message = $validation->message('title');

Get a failed message corresponding to the name.

  my $messgaes = $validation->messages;

Get all failed messages.

  my $messages_h = $validation->messages_to_hash;

Get all failed parameter names and messages as hash reference.

2015-12-12 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.