Answer the question
In order to leave comments, you need to log in
How to arrange processing of multiple Yii2 models in one form?
Good. There is a form on which there is a User, a Company and a Set of Company Contacts. It is necessary to fill everything in at once (if there is a company, then link it to an existing one). The question of such a plan is how best to build it logically? Validation and more.
Let's say you filled in the user, if you clicked the checkmark (or entered the name of the company), then you no longer need to validate the company model. If not, then we validate the company and validate the set of Contact models.
I would like a scheme for the operation of all this, I will write the code myself. I just don’t quite understand how to make it so that everything is beautiful by means of yu.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question