Answer the question
In order to leave comments, you need to log in
How to make field validation only for guest in yii2?
There is a form, for example feedback.
There are fields:
Answer the question
In order to leave comments, you need to log in
The easiest way to do this is with scripts, for example:
$model = new Feedback;
if ( --условие-- ) {
$model->scenario = Feedback::SCENARIO_GUEST;
}
Many options, you can have different models for different types of users, you can use: https://www.yiiframework.com/doc/api/2.0/yii-valid...
You can use scripts and https://www.yiiframework.com /doc/api/2.0/yii-valid...
There are probably more options, but I think these are enough
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question