Imagine this scenario (I think that's pretty common, so I don't
understand why I can't find any solution):

1. For the subscription process I only have 2 mandatory fields
"username" and "email". The password is created automatically.

2. Later, when the user is subscribed, he/she has the possibility to
complete his/her profile with additional information like first name,
last name, skype, etc.

3. For the login process I just need the username and password field
to be displayed.

So I want to show/hide the form fields dynamically in the controller
dependent to the action. So I only need to know how to access the
fields of an embedded form (which contains additional information to
sfUserGuard).

Best,
Florian


On Oct 19, 12:12 am, mintao <[email protected]> wrote:
> if there's a field called "last_name" in the embedded form called
> "profile", how can I access this?
>
> On 18 Okt., 11:15, geoffroy <[email protected]> wrote:
>
> > Hie,
>
> > I think you have ti unset() fields like :
>
> > class signForm extends PluginsfGuardUserForm
> > {
> >   public function configure()
> >   {
> >     $form = new sfGuardUserProfileForm();
> >     $this->embedForm('profile', $form);
>
> >     unset(
> >       $this['filed_u_dont_want1],
> >       $this['filed_u_dont_want2'],
> >     );
> >   }
>
> > }
>
> > Or try to unset() fields in your sfGuardProfileForm extend class.
>
> > Geo
>
> > On Oct 17, 11:35 pm, mintao <[email protected]> wrote:
>
> > > Hi folks,
>
> > > it's really no fun for a newbie to configure the symfony forms. I'm
> > > using 1.3Alpha2 and activated the plugin sfDoctrineUserGuard. The
> > > description of this plugin is so old that nearly nothing of the
> > > described steps worked.
> > > So 3 days later I'm trying to set up a sign up form. Therefore I use
> > > the sfGuardUserForm and  an embedded ProfileForm:
>
> > > class signForm extends PluginsfGuardUserForm
> > > {
> > >   public function configure()
> > >   {
> > >     $form = new sfGuardUserProfileForm();
> > >     $this->embedForm('profile', $form);
> > >     $this->useFields(array(
> > >         'username',
> > >         'profile.email',
> > >     ));
> > >   }
>
> > > }
>
> > > As you can imagine, I try only to display a username and  an email
> > > field. The username is part of the plugin, the email is part of the
> > > embedded form.
>
> > > My question: my version doesn't work. How can I display fields of
> > > embedded forms?
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to