Skip to content

Commit c34e5c3

Browse files
committed
minor #10854 Add $user variable in ->createForm(...) (bestog)
This PR was submitted for the 4.2 branch but it was merged into the 4.1 branch instead (closes #10854). Discussion ---------- Add $user variable in ->createForm(...) <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- 79aae2b Add $user variable in ->createForm(...)
2 parents 7c55784 + 79aae2b commit c34e5c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doctrine/registration_form.rst

+1-1
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)