mrbig00/yii2-class-validator

This validator test if an object (instance) is a subtype of a given class

Maintainers

Package info

github.com/mrbig00/yii2-class-validator

Type:yii2-extension

pkg:composer/mrbig00/yii2-class-validator

Statistics

Installs: 10

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-master 2019-08-30 09:07 UTC

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.

License

MIT