Forms of 2 models in one form

Hi all,

I have 2 seperate models models1 and model2. What i want to know is, is it possible to have the forms of both those models combined in one form and then save their values individually?If so how do i go about this?

Start by reading this wiki -

hi mdomba,

thanks for the reply. What you said has to be done in the controller but what i want to know is how do i combine the 2 forms inside one form and display it?

Please help me…


Have you read the wiki?

If yes… do you understand that you can create two models and send them both to the view with





Now in the view you have 2 models: $model1 and $model2… and you can create input fields for both of them…

NOTE: you posted in the Yii 1.0… do you use this version ?

hi, i want to ask u, i want to save one textfield into two different table, how can i do that?