if i add next to rules:
[['!coinsImage'], 'file', 'skipOnEmpty' => false, 'extensions' => 'png, jpg'],
i will exclude it from massive assignment, but can`t get that validator when use:
$model->getActiveValidators('coinsImage');
I think next condition wrong:
if ($validator->isActive($scenario) && ($attribute === null || in_array($attribute, $validator->attributes, true))) {
$validators[] = $validator;
}
| Q | A
| ---------------- | ---
| Yii version | 2.0.10
Workaround:
$model->getActiveValidators('!coinsImage');
but it is not obvious.
You can find a proper fix in my PR #13088
Most helpful comment
Workaround:
$model->getActiveValidators('!coinsImage');but it is not obvious.
You can find a proper fix in my PR #13088