You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor symfony#16284 [Form] Additional hints when rendering the same form in different templates (kschrenk)
This PR was submitted for the 6.0 branch but it was squashed and merged into the 5.4 branch instead.
Discussion
----------
[Form] Additional hints when rendering the same form in different templates
There is the following tip mentioned in the documentation (see chapter [Processing forms)](https://symfony.com/doc/current/forms.html#processing-forms):
```
If you need to render and process the same form in different templates, use the render() function to embed the controller that processes the form:
{{ render(controller('App\\Controller\\TaskController::new')) }}
```
In my point of view this can lead to extra work especially when it comes to validation and rendering error messages.
So my proposal is to add a hint like
```
But be careful because this might cause some extra work when it comes to submit and error handling.
Symfony Validation will get more complex when you render the same form in different routes.
```
<!--
If your pull request fixes a BUG, use the oldest maintained branch that contains
the bug (see https://symfony.com/releases 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 `5.x` for features of unreleased versions).
-->
Commits
-------
6092143 [Form] Additional hints when rendering the same form in different templates
0 commit comments