Download the PHP package yiisoft/validator without Composer
On this page you can find all versions of the php package yiisoft/validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yiisoft/validator
More information about yiisoft/validator
Files in yiisoft/validator
Package validator
Short Description Yii Validator
License BSD-3-Clause
Homepage https://www.yiiframework.com/
Informations about the package validator
Yii Validator
This package provides data validation capabilities.
Features
- Validates any data: arrays, objects, scalar values, etc.
- Supports custom data sets.
- Handles nested data structures (one-to-one and one-to-many).
- Can read validation rules from PHP 8 attributes.
- Error message formatting and translation.
- Attribute names translation.
- Conditional validation:
- Skip validation of "empty" value with possibility to configure "empty" condition.
- Skip further validation if an error occurred for the same property.
- Skip validation depending on a condition.
- Possibility to use context in rule handler.
- Common rules bundled.
- Supports DI container for creating custom rule handlers with extra dependencies.
- Exporting rules options for using in the frontend.
Requirements
- PHP 8.0 or higher.
mbstring
PHP extension.
Installation
The package could be installed with Composer:
General usage
Validator allows to check data in any format. For example, when data is an object:
The validation result is an object that allows to check whether validation was successful:
It also contains errors occurred during validation:
Documentation
- Guide: Português - Brasil
- Internals
If you need help or have a question, the Yii Forum is a good place for that. You may also check out other Yii Community Resources.
License
The Yii Validator is free software. It is released under the terms of the BSD License.
Please see LICENSE
for more information.
Maintained by Yii Software.
Support the project
Follow updates
All versions of validator with dependencies
ext-mbstring Version *
psr/container Version ^1.0|^2.0
psr/http-message Version ^1.0|^2.0
yiisoft/arrays Version ^2.1|^3.0
yiisoft/friendly-exception Version ^1.0
yiisoft/network-utilities Version ^1.2
yiisoft/strings Version ^2.1
yiisoft/translator Version ^2.1|^3.0