Answer the question
In order to leave comments, you need to log in
How to disable validation rule?
There is a field that is mandatory.
The task is to make it mandatory when adding a record and optional when editing (if left empty, just do not change)
That is, somehow disable the required rule from actionUpdate I
forgot to clarify that yii2
Answer the question
In order to leave comments, you need to log in
Got it!
In rules() we replace
with
having previously added a constant
and in the actionCreate () method we write$model->scenario = Administrator::SCENARIO_CREATE;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question