Any body can suggest to save a has many relation in yii.Since, i have seen some forum post which are suggesting to use extensions for it.But surely there will be any other solution for it.
I hope you guys can suggest me it.
Simply i have two relational table.
Table A has Many relation in Table B.
So, i have just define a relation in Model class of Table A.
public function relations()
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
And in My controller action code i am just using a
To save this relational values.But What i am getting is here Table A record is created perfectly But There is n any record available in Table B
Might be a silly mistake i am doing here.Anybody who can suggest me how to save a HAS_MANY relation with Yii and without help of any extension.
softark, I know about this processs which called Collecting tabuler formate.But i was thinking a bit different Here.Since In CakePHP i have used a HAS_MANY relation and define a proper syntax for it in model Class.Then Calling a $model_a->save(); in the action save this relation and also it works like a charm On updating and Deleting operation.
But Why this usefull feature is still not included In Yii. I am going to send a feature request for it.
i’m new to yii…am using these has_many relation to save data to database …while i search the result i found ur answer useful for me i think.but i had one doubt in this tabular input method…my question is that…the method getItemsToUpdate();i wrote in model file thst’s right?..but how i write the method i don’t have idea about it…so plz help me out to solve my issuses…