Skip to content

panwenbin/yii2-eithervalidator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yii2-either-validator

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')
    ]

About

Yii2 validator to force one of attributes to be filled.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%