Rules class
Framework\Validation\Rules
Class Rules.
Extends Framework\Validation\BaseRules
Implements:
Stringable
Defined in libraries/validation/src/Rules.php
Methods #
- alpha()
- Validates alphabetic characters.
- alphaNumber()
- Validates a number or alphabetic characters.
- array()
- Validates array.
- base64()
- Validates a base64 string.
- between()
- Validate field between min and max values.
- bool()
- Validates boolean.
- datetime()
- Validates a datetime format.
- dim()
- Validates image dimensions.
- email()
- Validates a email.
- equals()
- Validate field has value equals other field.
- ext()
- Validates file accepted extensions.
- float()
- Validates float.
- greater()
- Validates is greater than.
- greaterOrEqual()
- Validates is greater than or equal to.
- hex()
- Validates a hexadecimal string.
- hexColor()
- Validates a hexadecimal color.
- image()
- Validates file is an image.
- in()
- Validate field is in list.
- int()
- Validates integer.
- ip()
- Validates an IP.
- isset()
- Validates field is set.
- json()
- Validates a JSON string.
- latin()
- Validates a latin text.
- length()
- Validates exact length.
- less()
- Validates is less than.
- lessOrEqual()
- Validates is less than or equal to.
- maxDim()
- Validates image max dimensions.
- maxLength()
- Validates max length.
- maxSize()
- Validates file size.
- md5()
- Validates a md5 hash.
- mimes()
- Validates file accepted MIME types.
- minDim()
- Validates image min dimensions.
- minLength()
- Validates min length.
- notBetween()
- Validate field not between min and max values.
- notEquals()
- Validate field has not value equals other field.
- notIn()
- Validate field is not in list.
- notRegex()
- Validates a Regex no matching pattern.
- number()
- Validates a number.
- object()
- Validates object.
- regex()
- Validates a Regex pattern.
- required()
- Validates required value.
- slug()
- Validates slug.
- specialChar()
- Validates special characters.
- string()
- Validates string.
- timezone()
- Validates a timezone.
- uploaded()
- Validates file is uploaded.
- url()
- Validates an URL.
- uuid()
- Validates a UUID.
alpha()
Validates alphabetic characters.
alphaNumber()
Validates a number or alphabetic characters.
array()
Validates array.
base64()
Validates a base64 string.
between()
Validate field between min and max values.
- string|int $min
- string|int $max
bool()
Validates boolean.
datetime()
Validates a datetime format.
- string $format
dim()
Validates image dimensions.
- int $width
- int $height
email()
Validates a email.
equals()
Validate field has value equals other field.
- string $equalsField
ext()
Validates file accepted extensions.
NOTE: For greater security use the {@see FilesValidator::mimes()} method
to filter the file type.
- string $allowedExtensions
float()
Validates float.
greater()
Validates is greater than.
- string|int $greaterThan
greaterOrEqual()
Validates is greater than or equal to.
- string|int $greaterThanOrEqualTo
hex()
Validates a hexadecimal string.
hexColor()
Validates a hexadecimal color.
image()
Validates file is an image.
in()
Validate field is in list.
- string $in
- string $others
int()
Validates integer.
ip()
Validates an IP.
- int $version - 4, 6 or 0 to both
isset()
Validates field is set.
json()
Validates a JSON string.
latin()
Validates a latin text.
length()
Validates exact length.
- int $length
less()
Validates is less than.
- string|int $lessThan
lessOrEqual()
Validates is less than or equal to.
- string|int $lessThanOrEqualTo
maxDim()
Validates image max dimensions.
- int $width
- int $height
maxLength()
Validates max length.
- int $maxLength
maxSize()
Validates file size.
- int $kilobytes
md5()
Validates a md5 hash.
mimes()
Validates file accepted MIME types.
- string $allowedTypes
minDim()
Validates image min dimensions.
- int $width
- int $height
minLength()
Validates min length.
- int $minLength
notBetween()
Validate field not between min and max values.
- string|int $min
- string|int $max
notEquals()
Validate field has not value equals other field.
- string $diffField
notIn()
Validate field is not in list.
- string $notIn
- string $others
notRegex()
Validates a Regex no matching pattern.
- string $pattern
number()
Validates a number.
object()
Validates object.
regex()
Validates a Regex pattern.
- string $pattern
required()
Validates required value.
slug()
Validates slug.
specialChar()
Validates special characters.
- int $quantity
- string $characters
string()
Validates string.
timezone()
Validates a timezone.
uploaded()
Validates file is uploaded.
url()
Validates an URL.
uuid()
Validates a UUID.
Inherited methods #
-
__construct()fromFramework\Validation\BaseRules -
__toString()fromFramework\Validation\BaseRules -
__get()fromFramework\Validation\BaseRules -
optional()fromFramework\Validation\BaseRules -
blank()fromFramework\Validation\BaseRules -
null()fromFramework\Validation\BaseRules -
empty()fromFramework\Validation\BaseRules -
esc()fromFramework\Validation\BaseRules -
implode()fromFramework\Validation\BaseRules -
create()fromFramework\Validation\BaseRules