yii2-at-least-validator icon indicating copy to clipboard operation
yii2-at-least-validator copied to clipboard

Max quantity of chosen attributes

Open Maykonn opened this issue 8 years ago • 1 comments

Suppose that I have two fields, product 1 and product2. How to avoid that the two be filled but at least one must be filled?

Something like this is possible?

[
    ['product1', 'product2'], 
    AtLeastValidator::className(), 
    'in' => ['product1', 'product2'], 
    'max' => 1
],

Maykonn avatar Mar 28 '17 16:03 Maykonn

@Maykonn ... waiting your answer on the PR. Thank you.

sdlins avatar Jun 25 '17 14:06 sdlins