Open clytemnestra opened 8 years ago
This is currently not covered.
You can override pugx_user.manager.user_discriminator
service writing a compiler pass, then extend our UserDiscriminator
and override getFormType
method. You'll likely need also to override constructor to inject your form service.
Uh, that was what I was trying to avoid. Hopefully it will be supported in the future, often forms are used as services.
The constructor needs to inject any form's own services, I can't really hardcode it, though. Even thought the discriminator is used only for register/profile forms.
In the meantime, I've just changed the way I create the form in the controller: $form = $this->get('form.factory')->create($this->get('app_user_profile_type'));
where app_user_profile_type
is the form service.
Everything works fine if the forms are not defined as services and need something in their constructors. However, in my ProfileController:
calls
which calls
This works for normal forms, but not for service forms. It tries to call
in my case, which turns into the error
because my ProfilyType form defined as a service needs an object in its constructor
Is this a not covered feature of this bundle or am I doing something wrong?