Download the PHP package rnr1721/le7-validator without Composer
On this page you can find all versions of the php package rnr1721/le7-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package le7-validator
le7-validator
This is a simple and convenient PHP validator. It can be used to validate form input, API requests, and any other data that needs to be validated before being processed.
Requirements
- PHP 8.1
Installation
Testing
Usage
First you need to create an instance of the validator:
Then you need to define validation rules for each field:
Method setFullRule can take three arguments:
- Field - Field (key) for validate.
- Value - Data to validate
- Rules - Validation rules
- Label - Human-like name of field. It uses for get errors
And finally, you can check:
Present rules
Rules - is string of "|" - separated rules. For example:
- required: The field must be filled
- min:{n}: Field value must be at least {n}
- max:{n}: Field value must be no more than {n}
- minlength:{n}: The length of the string field value must be at least {n}
- maxlength:{n}: The length of the string field value must be no more than {n}
- email: The field value must be a valid email address
- notempty: The field value must not be empty or contain only spaces
- numeric: Validates that only numeric data
- email_dns: validates the format of an email address and checks if the domain part of the email address has a valid DNS record
- url: Validate URL
- url_active: If URL address is valid and exists
- date: Validates that value is date
- date_format:{n}: Validates date format: Example: date_format:Y-m-d
- date_before:{n}: Validate date before some date. Example: date_before:2022-05-15
- date_after:{n}: Validate date after some date. Example: date_after:2022-05-15
- boolean: Validate boolean
All versions of le7-validator with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.1
ext-gettext Version *
ext-gettext Version *
The package rnr1721/le7-validator contains the following files
Loading the files please wait ....