I think I need read through the sfForm API
lol

On May 7, 1:14 am, Campezzi <campe...@gmail.com> wrote:
> Hi Stephen,
>
> In your action code, when you're creating the form so that it's
> available on the view, you can do so with two parameters. The first
> one is an object used to populate the fields with default data; the
> second one is an array of variables you're passing from the action to
> the form object itself. So...
>
> $this->form = new FormClassName(array(), array('user_id' => $this-
>
> >getUser()->getId());
>
> ... would give you a form with no populated fields (the first
> parameter is an empty array), with a variable called user_id passed to
> the FormClassName object. You can then access the user_id variable on
> the form class by using the getOption method of the sfForm class:
>
> $this->getOption('user_id')
>
> Mix this with a custom method for getting the form field choices and I
> guess you have a solution there!
>
> Hope to have helped. Good luck! :)
>
> Thiago Campezzi
>
> On May 6, 11:45 am, Stephen <stephen.j.t...@gmail.com> wrote:
>
> > Thanks, but how can I pass a value to the method?
>
> > On Apr 20, 7:13 am, Joan Teixidó <eliog...@gmail.com> wrote:
>
> > > hi,
>
> > > you can create an instance of sfWidgetFormPropelChoice with the opcion
> > > peer_method:
>
> > > form['addres] = new  sfWidgetFormPropelChoice(array('model' =>
> > > 'myModel'',peer_method' => 'myMethod'))
>
> > > Joan
> > > 2009/4/19 Stephen <stephen.j.t...@gmail.com>
>
> > > > A form generated by symfony, there is a field "address". I don't want
> > > > it lists all the addresses in the dropdown list, but only the ones
> > > > associated with the user who is browsing this page, user has a user
> > > > ID. Could any one tell me how to implement this?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to