Data::FormValidator::Constraints::NumberPhone - Data constraints, using Number::Phone
use Data::FormValidator::Constraints::NumberPhone qw(FV_american_phone);
constraint_methods => {
phone => FV_american_phone(),
canada_phone => FV_american_phone(qw( CA )),
},
This module implements methods to help validate data using
Data::FormValidator
and Number::Phone
.
-
FV_american_phone()
Creates a constraint closure that returns true if the constrained value appears to be a valid North American telephone number (Canada, or US)
-
FV_telephone(@countries)
Creates a constraint closure that returns true if the constrained value appears to be a valid telephone number.
REQUIRES a list of Country Codes (e.g. "CA", "US", "UK"), to specify which countries should be considered valid. By default, *NO* countries are considered valid (and thus, no numbers are considered valid by default).
Graham TerMarsch ([email protected])
Copyright (C) 2012, Graham TerMarsch. All Rights Reserved.