Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Validator::Custom::ValUseriContributed Perl DoValidator::Custom::Validation(3)

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

SYNOPSYS
	 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;

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

   new
	 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;

   is_valid
	 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.

   add_failed
	 $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.

   failed
	 my $failed = $validation->failed;

       Get all failed parameter	names.

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

       Get a failed message corresponding to the name.

   messages
	 my $messgaes =	$validation->messages;

       Get all failed messages.

   messages_to_hash
	 my $messages_h	= $validation->messages_to_hash;

       Get all failed parameter	names and messages as hash reference.

perl v5.24.1			  2015-12-12  Validator::Custom::Validation(3)

NAME | SYNOPSYS | METHODS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Validator::Custom::Validation&sektion=3&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help