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


Manual Reference Pages  -  INPUT::VALIDATOR::FIELD (3)

.ds Aq ’

NAME

Input::Validator::Field - Field object

CONTENTS

SYNOPSIS



    $validator->field(foo);
    $validator->field(qw/foo bar/);
    $validator->field([qw/foo bar baz/]);



DESCRIPTION

Field object. Used internally.

ATTRIBUTES

CWmessages

Error messages.

CWdeflate



    $field->deflate(sub { s/foo/bar/ });



Use this when you want to change value of field after validation.

CWerror



    $field->error(Invalid input);
    my $error = $field->error;



Field error.

CWeach



    $field->each(sub { shift->required(1) });



Each method as described in Input::Validator::Bulk. Added here for convenience.

CWinflate



    $field->inflate(sub { s/foo/bar/ });



Use this when you want to change value of field before validation.

CWmultiple



    $field->multiple(1);



Field can have multiple values. Use this when you want to allow array reference as a value.



    $field->multiple(2, 5);



If you want to control how many multiple values there can be set min and max values.



    $field->multiple(10);



When max value is omitted and is not 1 (because it doesn’t make sense), number of values must be equal to this value.

CWname



    $field->name(foo);
    my $name = $field->name;



Field’s name.

CWrequired



    $field->required(1);



Whether field is required or not. See Input::Validator documentation what is an empty field.

CWtrim



    $field->trim(1);



Whether field’s value should be trimmed before validation. It is <B>ONB> by default.

METHODS

CWcallback

Shortcut



    $field->constraint(callback => sub { ... });



CWclear_error



    $field->clear_value;



Clears field’s error.

CWclear_value



    $field->clear_value;



Clears field’s value.

CWconstraint



    $field->constraint(length => [1, 2]);



Adds a new field’s constraint.

CWis_defined



    my $defined = $field->is_defined;



Checks whether field’s value is defined.

CWis_empty



    my $empty = $field->is_empty;



Checks whether field’s value is empty.

CWis_valid

Checks whether all field’s constraints are valid.

CWmessage

Holds error message.

CWvalue



    my $value = $field->value;
    $field->value(foo)



Set or get field’s value.

SEE ALSO

Input::Validator, Input::Validator::Constraint.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 INPUT::VALIDATOR::FIELD (3) 2011-10-27

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