mrbig00 / yii2-class-validator
This validator test if an object (instance) is a subtype of a given class
Package info
github.com/mrbig00/yii2-class-validator
Type:yii2-extension
pkg:composer/mrbig00/yii2-class-validator
dev-master
2019-08-30 09:07 UTC
Requires
- php: >=7.0
- yiisoft/yii2: ~2.0.11
This package is auto-updated.
Last update: 2026-03-01 00:13:24 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.