Interface Yiisoft\Validator\ValidatorInterface
| Implemented by | Yiisoft\ |
|---|
An interface allowing to validate the data according to the set of rules ({@see RuleInterface}) and validation context ({@see ValidationContext}). A class implementing it is called "validator".
Public Methods
| Method | Description | Defined By |
|---|---|---|
| validate() | Validates the data according to the set of rules ({@see RuleInterface}) and validation context ({@see ValidationContext}). | Yiisoft\ |
Method Details
Validates the data according to the set of rules ({@see RuleInterface}) and validation context ({@see ValidationContext}).
| public abstract Yiisoft\ | ||
| $data | Yiisoft\ |
Data to validate:
|
| $rules | callable|iterable|object|string|null |
Rules to apply for validating data. If specified, this
argument has higher priority over {@see \ |
| $context | Yiisoft\ |
Validation context that may be taken into account when performing validation. |
| return | Yiisoft\ |
The result of validation. |
|---|---|---|
| throws | ReflectionException |
If an object / {@see \ |
public function validate(
mixed $data,
callable|iterable|object|string|null $rules = null,
?ValidationContext $context = null,
): Result;
User Contributed Notes
Leave a comment
Join the conversation to share a note.