Class Validators
Validation utilities.
- Nette\Utils\Validators uses Nette\StaticClass
public static
|
|
public static
|
#
assertField( array $arr, string $field, string $expected = null, string $label = "item '%' in array" )
Throws exception if an array field is missing or of unexpected type. |
public static
boolean
|
|
public static
boolean
|
#
everyIs( array|
Finds whether all values are of expected type. |
public static
boolean
|
|
public static
boolean
|
|
public static
boolean
|
|
public static
boolean
|
|
public static
boolean
|
|
public static
boolean
|
|
public static
boolean
|
|
public static
boolean
|
|
public static
boolean
|
|
public static
boolean
|
|
public static
boolean
|
|
public static
boolean
|
|
public static
boolean
|
__callStatic(),
__construct()
|
protected static
array
|
$validators
|
# [
'bool' => 'is_bool',
'boolean' => 'is_bool',
'int' => 'is_int',
'integer' => 'is_int',
'float' => 'is_float',
'number' => [__CLASS__, 'isNumber'],
'numeric' => [__CLASS__, 'isNumeric'],
'numericint' => [__CLASS__, 'isNumericInt'],
'string' => 'is_string',
'unicode' => [__CLASS__, 'isUnicode'],
'array' => 'is_array',
'list' => [Arrays::class, 'isList'],
'object' => 'is_object',
'resource' => 'is_resource',
'scalar' => 'is_scalar',
'callable' => [__CLASS__, 'isCallable'],
'null' => 'is_null',
'email' => [__CLASS__, 'isEmail'],
'url' => [__CLASS__, 'isUrl'],
'uri' => [__CLASS__, 'isUri'],
'none' => [__CLASS__, 'isNone'],
'type' => [__CLASS__, 'isType'],
'identifier' => [__CLASS__, 'isPhpIdentifier'],
'pattern' => null,
'alnum' => 'ctype_alnum',
'alpha' => 'ctype_alpha',
'digit' => 'ctype_digit',
'lower' => 'ctype_lower',
'upper' => 'ctype_upper',
'space' => 'ctype_space',
'xdigit' => 'ctype_xdigit',
'iterable' => [__CLASS__, 'isIterable'],
] |
protected static
array
|
$counters
|
# [
'string' => 'strlen',
'unicode' => [Strings::class, 'length'],
'array' => 'count',
'list' => 'count',
'alnum' => 'strlen',
'alpha' => 'strlen',
'digit' => 'strlen',
'lower' => 'strlen',
'space' => 'strlen',
'upper' => 'strlen',
'xdigit' => 'strlen',
] |