Answer the question
In order to leave comments, you need to log in
How can you make rules in Yii?
Good afternoon.
Available on the field page. "Registration" and "Authorization". This is one form.
How to make it so that when you click "authorize" the rules are executed only for authorization fields.
Well, in fact, so that when you click "registration" the rules for the registration fields are fulfilled.
Let me remind you that this is one form. And there is only one model.
If to hang up on jquery on buttons event that to add hidden fields.
And then in the rules do something like:
if($_POST['from']['aut'] == 1) { // выполняем правила для авторизации }
Answer the question
In order to leave comments, you need to log in
Divide into two forms. You shouldn't create problems for yourself.
Then do this:
<input type="submit" name="a">
<input type="submit" name="b">
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question