This is one of my validation rules for a model:
[‘my_field’, ‘required’, ‘when’ => function($model) {
return $model->status != 0;
}],
But the field is always required.
What am i doing wrong?
I tested with xdebug and the function does work, $model->status is 0.
I even changed the function to be a simple return TRUE; , but nothing