Yii Framework Forum: Custom Form With Parts Linked To Other Model - Yii Framework Forum

Jump to content

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

Custom Form With Parts Linked To Other Model Rate Topic: -----

#1 User is offline   Leto 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 19
  • Joined: 11-February 13

Posted 14 February 2013 - 04:27 AM

Hi,

i'm madding a form that does not represent a database table but it contains a part "mapped" to a database table (like a belong_to relation).

So you can consider a contact form in which you can choose to whom send the email with a dropdown list that represent users in database.
And below you can type your email subject and content.

So here the contact form is not stored in the database, so it is not an ActiveRecord instance, but it contains "relation" like an ActiveRecord has.

My question is : How do i build my form class ?
I want to be able to do this in the view :
$activeFormWidget->dropdown($form->user, 'name', User::model()->getUsers());

Thanks
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