Answer the question
In order to leave comments, you need to log in
[[+content_image]]
Yii2, validation, don't use rule when using script?
To use the rule in a specific scenario, we do this:
[['phone', 'email'], 'required', 'on' => self::SCENARIO_DEFAULT],
Answer the question
In order to leave comments, you need to log in
to specify a script to which the validation rule should not apply, you must specify its name in the except parameter of the rule , for example:
[['phone', 'email'], 'required', 'except' => self::SCENARIO_DEFAULT],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question