mrbig00 / yii2-class-validator
This validator test if an object (instance) is a subtype of a given class
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=7.0
- yiisoft/yii2: ~2.0.11
This package is auto-updated.
Last update: 2025-04-29 01:14:51 UTC
README
ClassValidator checks if the attribute is a subtype of a given class
Installation
Use the package manager composer to install the Yii2 class validator.
composer require mrbig00/yii2-class-validator
Usage
public function rules(){ return [ [['client'], ClassValidator::class, 'skipOnEmpty' => false, 'targetClass' => Client::class], ... ]; }
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.