Skip to content

Commit

Permalink
Add $user variable in ->createForm(...)
Browse files Browse the repository at this point in the history
  • Loading branch information
bestog authored and javiereguiluz committed Jan 8, 2019
1 parent 7c55784 commit 79aae2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doctrine/registration_form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ saves the user::
public function register(Request $request, UserPasswordEncoderInterface $passwordEncoder): Response
{
$user = new User();
$form = $this->createForm(RegistrationFormType::class);
$form = $this->createForm(RegistrationFormType::class, $user);
$form->handleRequest($request);

if ($form->isSubmitted() && $form->isValid()) {
Expand Down

0 comments on commit 79aae2b

Please sign in to comment.