saving form's information in 2 models

I am making a website which can help in the reservation of apparatuses in the chemistry lab…

this is my first time trying out yii, a real newbiw

so far I have a database with tables apparatus (for inventory) and transaction (for when people are going to reserve)

In the apparatus controller I made a php file called "reservation" which contains a CListview showing all the apparatuses with a text field so that people could input the quantity they want to reserve

but within the reservation file… I want a textfield which is for the borrower’s information which is located in the table: transaction

what is the ideal form to use? Chtml? or $form? and how do you connect it to the database via $_POST? what are the codes in the controller?

Hi,

I think you need to use the CActiveform. This wiki can help you: http://www.yiiframework.com/wiki/19/how-to-use-a-single-form-to-collect-data-for-two-or-more-models/

isn’t there any other way because the tutorial suggests that the form should be in _forms

and mine is in a separate php file

plus the _form of the transaction view does not accept the Clistview with details coming from the apparatus model :confused:

Please, share your code for a better help.