Skip to content

Commit b1e4e97

Browse files
committed
Merge branch '5.1' into 5.2
* 5.1: Mention a possible way of reusing the same form
2 parents 58a4492 + f36e674 commit b1e4e97

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

forms.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,16 @@ possible paths:
449449
data is passed to it, you can
450450
:doc:`use the submit() method to handle form submissions </form/direct_submit>`.
451451

452+
.. tip::
453+
454+
If you need to render and process the same form in different templates,
455+
use the ``render()`` function to :ref:`embed the controller <templates-embed-controllers>`
456+
that processes the form:
457+
458+
.. code-block:: twig
459+
460+
{{ render(controller('App\\Controller\\TaskController::new')) }}
461+
452462
.. _validating-forms:
453463

454464
Validating Forms

0 commit comments

Comments
 (0)