Manual Reference Pages - FORM::SENSIBLE::VALIDATOR (3)
Form::Sensible::Validator - Default Validator for Form::Sensible forms
my $object = Form::Sensible::Validator->new();
$validator_result = $object->validate($form);
Form::Sensible::Validator performs the grunt work of validating a form. It
understands how to handle regex based field validation as well as
coderef based field validation. It also is responsible for calling
field-type specific validation. Usually this class is not manipulated
directly. Instead, $form->validate() is used, which in turn calls
the validator already associated with the form (or creates one if none is
Performs validation of a Form. Returns a
with the results of form validation for the passed form.
Performs complete validation on the given field. Returns an array of
hashes containing error messaging (or an empty array on success.) Each hash
returned will contain a key of either error or missing and
a value containing the error message.
Internal routine to perform regex based validation of a field.
Internal routine to perform code based validation of a field. When called, the
$coderef is called with the fields value as the first argument, and the
field itself as the second:
The subroutine is expected to return 0 on successful validation, or an
appropriate error message on failed validation. This may seem somewhat
confusing, returning 0 on a valid field. It may help to think of the coderef
as being the equivalent of a is_field_invalid() routine.
message_delegate: ($caller, $field, $message)
The message_delegate is used to assemble error and other validation related
messages. By default the message_delegate simply loads $message and replaces
any occurance of _FIELDNAME_ with the fields name. Should return the processed
message. This is an ideal place to handle localization of messages or other
customization. If no translation can be found, you are strongly encouraged
to return the message as is (with _FIELDNAME_ converted to the actual field
name, of course.)
Jay Kuri - <firstname.lastname@example.org>
Ionzero LLC. <http://ionzero.com/>
Copyright 2009 by Jay Kuri <email@example.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|perl v5.20.3 ||FORM::SENSIBLE::VALIDATOR (3) ||2012-02-02 |
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.