How to create form to save two tables

Hi, I am still new in yii framework and I am still learning…I have some problem I want to create a form that has these textfields,

clientNo_txtfield

clientname_txtfield

clientaddress_txtfield

client_amntpaid_txtfield

I want to save the clientNo and client_amntpaid to my table "clientMST"

and the clientname,clientaddress to the table "clientInfo"

How can I achieve this if I pressed the button save the data will be inserted to the two tables that I mentioned…I know how to do this if I am not using framework. I can achieve this like normal php script,…but in yii I am confuse how to achieve this to insert in two tables.

I hope yii people will help me

Thank you in advance.

You have to generate two models (with gii).

Then follow this wiki.

Thank you :)

After U create models for those 2 tables all U should to is to instantiate them in controllers action:

$model1 = new ModelOne();

$model2 = new ModelTwo();

and send them to view, after that U can user CActiveForm like U for both models and submit form with all inputs.