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?
Page 1 of 1
Forms of 2 models in one form
#2
Posted 01 June 2011 - 04:14 PM
Start by reading this wiki - http://www.yiiframew...-or-more-models
Find more about me.... btw. Do you know your WAN IP?
#3
Posted 02 June 2011 - 12:14 AM
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..
Thanks
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..
Thanks
#4
Posted 02 June 2011 - 01:36 AM
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...
If yes... do you understand that you can create two models and send them both to the view with
$this->render('create',array( 'model1'=>$model1, 'model2'=>$model2 ));
Now in the view you have 2 models: $model1 and $model2... and you can create input fields for both of them...
Find more about me.... btw. Do you know your WAN IP?
#5
Posted 02 June 2011 - 03:39 AM
NOTE: you posted in the Yii 1.0 sub.forum... do you use this version ?
Find more about me.... btw. Do you know your WAN IP?
#6
Posted 12 July 2012 - 09:08 PM
hi, i want to ask u, i want to save one textfield into two different table, how can i do that?
Where there's a will, there's a way
Share this topic:
Page 1 of 1