Reputation: 11317
I am trying to figure out the registration process of the FosUserBundle and have been unable to do so.
I want to be able to register a user manually using custom fields and have been unable to see that in the code.
I have the registerAction in FosUserBundle and following it anywhere does not show me where the information is actually stored in the database:
public function registerAction()
{
$form = $this->container->get('fos_user.registration.form');
$formHandler = $this->container->get('fos_user.registration.form.handler');
$confirmationEnabled = $this->container->getParameter('fos_user.registration.confirmation.enabled');
$process = $formHandler->process($confirmationEnabled);
if ($process) {
$user = $form->getData();
if ($confirmationEnabled) {
$this->container->get('session')->set('fos_user_send_confirmation_email/email', $user->getEmail());
$route = 'fos_user_registration_check_email';
} else {
$this->authenticateUser($user);
$route = 'fos_user_registration_confirmed';
}
$this->setFlash('fos_user_success', 'registration.flash.user_created');
$url = $this->container->get('router')->generate($route);
return new RedirectResponse($url);
}
return $this->container->get('templating')->renderResponse('FOSUserBundle:Registration:register.html.'.$this->getEngine(), array(
'form' => $form->createView(),
'theme' => $this->container->getParameter('fos_user.template.theme'),
));
}
How do I register a user manually?
Thanks
Upvotes: 0
Views: 3678
Reputation: 2388
Have you read this in the FOSUserBundle docs?
Apparently the service UserManager has the responsibility to actually save and update the user, you could create your own UserManager by following the guide.
Edit: Symfony has incorporated the documentation for the FOSUserBundle into their own documentation, as so the new link for the documentation is: https://symfony.com/doc/master/bundles/FOSUserBundle/index.html
Upvotes: 2