Skip to content

Commit 79aae2b

Browse files
bestogjaviereguiluz
authored andcommitted
Add $user variable in ->createForm(...)
1 parent 7c55784 commit 79aae2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doctrine/registration_form.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ saves the user::
152152
public function register(Request $request, UserPasswordEncoderInterface $passwordEncoder): Response
153153
{
154154
$user = new User();
155-
$form = $this->createForm(RegistrationFormType::class);
155+
$form = $this->createForm(RegistrationFormType::class, $user);
156156
$form->handleRequest($request);
157157

158158
if ($form->isSubmitted() && $form->isValid()) {

0 commit comments

Comments
 (0)