8000 Add documentation for label_raw attribute by alexander-schranz · Pull Request #11513 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Add documentation for label_raw attribute #11513

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions form/form_customization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,12 @@ label you want to display as the second argument.
{{ form_label(form.name) }}

{# The two following syntaxes are equivalent #}
{{ form_label(form.name, 'Your Name', {'label_attr': {'class': 'foo'}}) }}
{{ form_label(form.name, 'Your Name', {'label_attr': {'class': 'foo'}, 'label_raw': true}) }}

{{ form_label(form.name, null, {
'label': 'Your name',
'label_attr': {'class': 'foo'}
'label_attr': {'class': 'foo'},
'label_raw': true
}) }}

See ":ref:`twig-reference-form-variables`" to learn about the ``variables``
Expand Down Expand Up @@ -409,6 +410,7 @@ Variable Usage
``id`` The ``id`` HTML attribute to be rendered.
``label`` The string label that will be rendered.
``label_attr`` A key-value array that will be rendered as HTML attributes on the label.
``label_raw`` If ``true`` the twig raw filter will be used to render the label text.
``method`` The method of the current form (POST, GET, etc.).
``multipart`` If ``true``, ``form_enctype`` will render ``enctype="multipart/form-data"``.
``name`` The name of the field (e.g. ``title``) - but not the ``name``
Expand Down
0