Skip to content

Commit c8e1d56

Browse files
committed
Merge pull request #1953 from WouterJ/correct_named_twig_arguments
Changed wrong argument names
2 parents 3a7fe96 + 2a3dc8d commit c8e1d56

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

reference/forms/twig_reference.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ widgets, etc).
1111

1212
.. _reference-forms-twig-label:
1313

14-
form_label(form.name, label, variables)
15-
---------------------------------------
14+
form_label(view, label, variables)
15+
----------------------------------
1616

1717
Renders the label for the given field. You can optionally pass the specific
1818
label you want to display as the second argument.
@@ -30,8 +30,8 @@ argument.
3030

3131
.. _reference-forms-twig-errors:
3232

33-
form_errors(form.name)
34-
----------------------
33+
form_errors(view)
34+
-----------------
3535

3636
Renders any errors for the given field.
3737

@@ -44,8 +44,8 @@ Renders any errors for the given field.
4444
4545
.. _reference-forms-twig-widget:
4646

47-
form_widget(form.name, variables)
48-
---------------------------------
47+
form_widget(view, variables)
48+
----------------------------
4949

5050
Renders the HTML widget of a given field. If you apply this to an entire form
5151
or collection of fields, each underlying form row will be rendered.
@@ -67,8 +67,8 @@ argument.
6767

6868
.. _reference-forms-twig-row:
6969

70-
form_row(form.name, variables)
71-
------------------------------
70+
form_row(view, variables)
71+
-------------------------
7272

7373
Renders the "row" of a given field, which is the combination of the field's
7474
label, errors and widget.
@@ -87,7 +87,7 @@ argument.
8787

8888
.. _reference-forms-twig-rest:
8989

90-
form_rest(form, variables)
90+
form_rest(view, variables)
9191
--------------------------
9292

9393
This renders all fields that have not yet been rendered for the given form.
@@ -101,7 +101,7 @@ obvious (since it'll render the field for you).
101101
102102
.. _reference-forms-twig-enctype:
103103

104-
form_enctype(form)
104+
form_enctype(view)
105105
------------------
106106

107107
If the form contains at least one file upload field, this will render the

reference/twig_reference.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,28 @@ Functions
2626
| ``asset_version(packageName = null)`` | Get the current version of the package, more information in |
2727
| | ":ref:`book-templating-assets`". |
2828
+----------------------------------------------------+--------------------------------------------------------------------------------------------+
29-
| ``form_enctype(form)`` | This will render the required ``enctype="multipart/form-data"`` attribute |
29+
| ``form_enctype(view)`` | This will render the required ``enctype="multipart/form-data"`` attribute |
3030
| | if the form contains at least one file upload field, more information in |
3131
| | in :ref:`the Twig Form reference<reference-forms-twig-enctype>`. |
3232
+----------------------------------------------------+--------------------------------------------------------------------------------------------+
33-
| ``form_widget(form, variables = {})`` | This will render a complete form or a specific HTML widget of a field, |
33+
| ``form_widget(view, variables = {})`` | This will render a complete form or a specific HTML widget of a field, |
3434
| | more information in :ref:`the Twig Form reference<reference-forms-twig-widget>`. |
3535
+----------------------------------------------------+--------------------------------------------------------------------------------------------+
36-
| ``form_errors(form)`` | This will render any errors for the given field or the "global" errors, |
36+
| ``form_errors(view)`` | This will render any errors for the given field or the "global" errors, |
3737
| | more information in :ref:`the Twig Form reference<reference-forms-twig-errors>`. |
3838
+----------------------------------------------------+--------------------------------------------------------------------------------------------+
39-
| ``form_label(form, label = null, variables = {})`` | This will render the label for the given field, more information in |
39+
| ``form_label(view, label = null, variables = {})`` | This will render the label for the given field, more information in |
4040
| | :ref:`the Twig Form reference<reference-forms-twig-label>`. |
4141
+----------------------------------------------------+--------------------------------------------------------------------------------------------+
42-
| ``form_row(form, variables = {})`` | This will render the row (the field's label, errors and widget) of the |
42+
| ``form_row(view, variables = {})`` | This will render the row (the field's label, errors and widget) of the |
4343
| | given field, more information in :ref:`the Twig Form reference<reference-forms-twig-row>`. |
4444
+----------------------------------------------------+--------------------------------------------------------------------------------------------+
45-
| ``form_rest(form, variables = {})`` | This will render all fields that have not yet been rendered, more |
45+
| ``form_rest(view, variables = {})`` | This will render all fields that have not yet been rendered, more |
4646
| | information in :ref:`the Twig Form reference<reference-forms-twig-rest>`. |
4747
+----------------------------------------------------+--------------------------------------------------------------------------------------------+
4848
| ``_form_is_choice_group(label)`` | This will return ``true`` if the label is a choice group. |
4949
+----------------------------------------------------+--------------------------------------------------------------------------------------------+
50-
| ``_form_is_choice_selected(form, choice)`` | This will return ``true`` if the given choice is selected. |
50+
| ``_form_is_choice_selected(view, choice)`` | This will return ``true`` if the given choice is selected. |
5151
+----------------------------------------------------+--------------------------------------------------------------------------------------------+
5252
| ``is_granted(role, object = null, field = null)`` | This will return ``true`` if the current user has the required role, more |
5353
| | information in ":ref:`book-security-template`" |
@@ -87,7 +87,7 @@ Filters
8787
+---------------------------------------------------------------------------------+-------------------------------------------------------------------+
8888
| ``path|file_excerpt(line)`` | This will render an excerpt of a code file around the given line. |
8989
+---------------------------------------------------------------------------------+-------------------------------------------------------------------+
90-
| ``path|format_file(line, text)`` | This will render a file path in a link. |
90+
| ``path|format_file(line, text = null)`` | This will render a file path in a link. |
9191
+---------------------------------------------------------------------------------+-------------------------------------------------------------------+
9292
| ``exceptionMessage|format_file_from_text`` | Equal to ``format_file`` except it parsed the default PHP error |
9393
| | string into a file path (i.e. 'in foo.php on line 45') |

0 commit comments

Comments
 (0)