Skip to content

[Form] form add extra data #20853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: 6.4
Choose a base branch
from
Prev Previous commit
Next Next commit
Fix twig syntax
  • Loading branch information
Arkalo2 committed Apr 8, 2025
commit 92dd2021e218cddceefd184c28e5123e65a72119
4 changes: 2 additions & 2 deletions forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -981,15 +981,15 @@ This is a creation user form::

The extra fields can be injected like this:

.. code-block:: twig
.. code-block:: html+twig

{# templates/user/create.html.twig #}
{{ form_start(form) }}
{{ form_row(form.username) }}
{{ form_row(form.email) }}

{# Hidden field to send additional sponsorship code #}
<input type="hidden" name="user_create[referralCode]" value="{{ referralCode }}" />
<input type="hidden" name="user_create[referralCode]" value="{{ referralCode }}"/>

<button type="submit">Submit</button>
{{ form_end(form) }}
Expand Down