Skip to content

Commit fdb7b67

Browse files
committed
Update code to the latest helper behavior
1 parent 773e816 commit fdb7b67

6 files changed

+19
-7
lines changed

controller/upload_file.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ Finally, you need to update the code of the controller that handles the form::
174174
return $this->redirectToRoute('app_product_list');
175175
}
176176

177-
return $this->renderForm('product/new.html.twig', $form);
177+
return $this->renderForm('product/new.html.twig', [
178+
'form' => $form,
179+
]);
178180
}
179181
}
180182

form/direct_submit.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ control over when exactly your form is submitted and what data is passed to it::
2929
}
3030
}
3131

32-
return $this->renderForm('task/new.html.twig', $form);
32+
return $this->renderForm('task/new.html.twig', [
33+
'form' => $form,
34+
]);
3335
}
3436

3537
The list of fields submitted with the ``submit()`` method must be the same as

form/dynamic_form_modification.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,9 @@ your application. Assume that you have a sport meetup creation controller::
534534
// ... save the meetup, redirect etc.
535535
}
536536

537-
return $this->renderForm('meetup/create.html.twig', $form);
537+
return $this->renderForm('meetup/create.html.twig', [
538+
'form' => $form,
539+
]);
538540
}
539541

540542
// ...

form/form_collections.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ In your controller, you'll create a new form from the ``TaskType``::
164164
// ... do your form processing, like saving the Task and Tag entities
165165
}
166166

167-
return $this->renderForm('task/new.html.twig', $form);
167+
return $this->renderForm('task/new.html.twig', [
168+
'form' => $form,
169+
]);
168170
}
169171
}
170172

form/form_customization.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ enough to render an entire form, including all its fields and error messages:
2121
.. code-block:: twig
2222
2323
{# form is a variable passed from the controller via either
24-
$this->renderForm('...', $form)
24+
$this->renderForm('...', ['form' => $form])
2525
or $this->render('...', ['form' => $form->createView()]) #}
2626
{{ form(form) }}
2727

forms.rst

+6-2
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ Now that the form has been created, the next step is to render it::
275275

276276
$form = $this->createForm(TaskType::class, $task);
277277

278-
return $this->renderForm('task/new.html.twig', $form);
278+
return $this->renderForm('task/new.html.twig', [
279+
'form' => $form,
280+
]);
279281
}
280282
}
281283

@@ -410,7 +412,9 @@ written into the form object::
410412
return $this->redirectToRoute('task_success');
411413
}
412414

413-
return $this->renderForm('task/new.html.twig', $form);
415+
return $this->renderForm('task/new.html.twig', [
416+
'form' => $form,
417+
]);
414418
}
415419
}
416420

0 commit comments

Comments
 (0)