Multiple models in a single form

Hi,

I had a question and I wanted your opinions.

If I have a form that has input data that needs to go in more than 1 table.

Should I have a model for each portion that belongs to their specific tables?

Example:

Product and Product Description.

So I guess I would pass two models, $model and $model_description and have seperate validations for each.

Or is there a preferable other way in doing this?

Thanks!

This cookbook can give you some idea - http://www.yiiframework.com/doc/cookbook/19/

This forum post too - http://www.yiiframework.com/forum/index.php?/topic/9476-

Thank you for your answer, the way I am doing right now is im using a Form Model to validate my inputs and then using the appropriate active record models to save.

I am always open to suggestions.

I will look at what you’ve posted thanks!