panwenbin / yii2-eithervalidator
Yii2 validator for either attributes is required
Installs: 158
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 2
pkg:composer/panwenbin/yii2-eithervalidator
Requires
- php: >=5.4.0
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2025-10-06 20:30:03 UTC
README
Yii2 validator for either attributes is required
Installation
composer require "panwenbin/yii2-eithervalidator"
Usage
Add a rule similar to the following to rules of the model
[ ['email'], EitherValidator::className(), 'eitherAttributes' => ['phone'], 'message' => Yii::t('app', 'Either attribute {attribute}, {either_attributes} is required') ]