Skip to content

Commit d4358eb

Browse files
committed
Mention a possible way of reusing the same form
1 parent d1e14b8 commit d4358eb

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)