Skip to content

Update registration_form.rst #11015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions doctrine/registration_form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ The form class for the registration form will look something like this::
new Length([
'min' => 6,
'minMessage' => 'Your password should be at least {{ limit }} characters',
'max' => 4096
'max' => 4096,
]),
],
])
Expand Down Expand Up @@ -170,7 +170,7 @@ saves the user::

// do anything else you need here, like send an email

return $this->redirect('app_homepage');
return $this->redirectToRoute('app_homepage');
}

return $this->render('registration/register.html.twig', [
Expand Down Expand Up @@ -223,13 +223,13 @@ To do this, add a ``termsAccepted`` field to your form, but set its
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('email', EmailType::class);
->add('email', EmailType::class)
// ...
->add('termsAccepted', CheckboxType::class, [
'mapped' => false,
'constraints' => new IsTrue(),
])
);
;
}
}

Expand Down