Twig Components / Methods / form_row
Note: You are currently reading the documentation for Bolt 5.0. Looking for the documentation for Bolt 5.2 instead?
form_row(form_view, variables)
is a Twig function to render the “row” of a given field, which is the combination of
the field’s label, errors, help and widget.
{# render a field row, but display a label with text "foo" #}
{{ form_row(form.name, {'label': 'foo'}) }}
The second argument to form_row()
is an array of variables. The templates provided in Symfony only allow to override
the label as shown in the example above.
See Form Variables to learn about the variables argument.
Source: Forms
Edit this page on GitHub
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.