Yii Framework Forum: Saving from into 2 models - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Saving from into 2 models Data to one model, file to second model Rate Topic: -----

#1 User is offline   pc131 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 133
  • Joined: 28-July 10
  • Location:Warsaw, Poland

Posted 02 November 2010 - 08:36 AM

TITLE should be: Saving form into 2 models can't edit title...

Hi

I've been searching forums, but more topics on getting data from multiple models, can't find how to save data from 1 form (text, integers and file) into 2 models.

I have 2 models: Users and Docs

Users:

id
name
id_doc


Docs:

id
content


Users.id_doc=Docs.id

On the create form of model User I have FileField which I want to save to model Docs, rest of the data (text, integers) will be saved to ::self model User. How can I save simultaneously User data to Users model and corresponding doc to Docs table/model?
0

#2 User is offline   zaccaria 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 2,232
  • Joined: 04-October 09
  • Location:Moscow

Posted 02 November 2010 - 08:40 AM

Here there is a wiki of Quiang for you.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users