Greetings.

There is a model (AR) - Photo. Fields id, user_id, imagem, description .

It is necessary to display several models in the form (all photos that belong to the user) and make sure that the user fills in the description all photos. Ideally, save the description photo that the user has filled in, for the rest show the error.

Tell me, if you have thoughts, how can this be realized?

    2 answers 2

    An example of implementation from an off-site form with two models.

    But, in this case, it seems, you need to look in the direction of the table entry .

    • Thank. It seems that this is just what I need. - Dmytro

    How it is done with the help of a generator when I don’t remember yii-shnogo, but in HTML the name parameter for the fields should be the form Model [] [property], and not Model [property]. Then in the $ _POST ['Model'] controller you will have an array containing all the models. It remains to bypass the array of models and check / save them.

    • Thanks for the option. I'll think about it. - Dmytro