M
M
Michael2017-10-15 02:32:26
Yii
Michael, 2017-10-15 02:32:26

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

1 answer(s)
D
Dmitry, 2017-10-15
@slo_nik

Good morning.
As much as it is not necessary, it is very necessary. All data must be verified.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question