Skip to content

Commit 5c87af9

Browse files
committed
Fixed the highlighting of some form Twig code examples
1 parent eeeed92 commit 5c87af9

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

form/action_method.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ options:
117117
Finally, you can override the action and method in the template by passing them
118118
to the ``form()`` or the ``form_start()`` helper functions:
119119

120-
.. code-block:: html+twig
120+
.. code-block:: twig
121121
122122
{# templates/default/new.html.twig #}
123123
{{ form_start(form, {'action': path('target_route'), 'method': 'GET'}) }}

form/bootstrap4.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Bootstrap 4 has a feature called "`custom forms`_". You can enable that on your
9595
Symfony Form ``RadioType`` and ``CheckboxType`` by adding a class called ``radio-custom``
9696
and ``checkbox-custom`` respectively.
9797

98-
.. code-block:: html+twig
98+
.. code-block:: twig
9999
100100
{{ form_row(form.myRadio, {label_attr: {class: 'radio-custom'} }) }}
101101
{{ form_row(form.myCheckbox, {label_attr: {class: 'checkbox-custom'} }) }}

form/form_collections.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ new "tag" forms. To render it, make the following change to your template:
295295
on it. You could even choose to render only one of its fields (e.g. the
296296
``name`` field):
297297

298-
.. code-block:: html+twig
298+
.. code-block:: twig
299299
300300
{{ form_widget(form.tags.vars.prototype.name)|e }}
301301

form/form_customization.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Some of the Twig functions mentioned in the previous section allow to pass
8686
variables to configure their behavior. For example, the ``form_label()``
8787
function lets you define a custom label to override the one defined in the form:
8888

89-
.. code-block:: html+twig
89+
.. code-block:: twig
9090
9191
{{ form_label(form.task, 'My Custom Task Label') }}
9292
@@ -96,7 +96,7 @@ type, but one common option is ``attr``, which allows you to modify HTML
9696
attributes on the form element. The following would add the ``task_field`` CSS
9797
class to the rendered input text field:
9898

99-
.. code-block:: html+twig
99+
.. code-block:: twig
100100
101101
{{ form_widget(form.task, {'attr': {'class': 'task_field'}}) }}
102102
@@ -116,7 +116,7 @@ If you need to render form fields "by hand" then you can access individual
116116
values for fields (such as the ``id``, ``name`` and ``label``) using its
117117
``vars`` property. For example to get the ``id``:
118118

119-
.. code-block:: html+twig
119+
.. code-block:: twig
120120
121121
{{ form.task.vars.id }}
122122

form/form_themes.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Although most of the times you'll apply form themes globally, you may need to
102102
apply a theme only to some specific form. You can do that with the
103103
:ref:`form_theme Twig tag <reference-twig-tag-form-theme>`:
104104

105-
.. code-block:: html+twig
105+
.. code-block:: twig
106106
107107
{# this form theme will be applied only to the form of this template #}
108108
{% form_theme form 'foundation_5_layout.html.twig' %}
@@ -137,7 +137,7 @@ Applying Different Themes to Child Forms
137137

138138
You can also apply a form theme to a specific child of your form:
139139

140-
.. code-block:: html+twig
140+
.. code-block:: twig
141141
142142
{% form_theme form.a_child_form 'form/my_custom_theme.html.twig' %}
143143
@@ -161,7 +161,7 @@ can be installed on different Symfony apps (and so you can't control what themes
161161
are enabled globally). To do that, add the ``only`` keyword after the list of
162162
form themes:
163163

164-
.. code-block:: html+twig
164+
.. code-block:: twig
165165
166166
{% form_theme form with ['foundation_5_layout.html.twig'] only %}
167167
@@ -175,7 +175,7 @@ form themes:
175175
yourself, or extend one of the built-in form themes with Twig's ``use``
176176
keyword instead of ``extends`` to re-use the original theme contents.
177177

178-
.. code-block:: html+twig
178+
.. code-block:: twig
179179
180180
{# templates/form/common.html.twig #}
181181
{% use "form_div_layout.html.twig" %}
@@ -192,7 +192,7 @@ with one or more of those blocks that you want to use when rendering a form.
192192
Consider for example a form field that represents an integer property called
193193
``age``. If you add this to the template:
194194

195-
.. code-block:: html+twig
195+
.. code-block:: twig
196196
197197
{{ form_widget(form.age) }}
198198
@@ -377,7 +377,7 @@ rules to know which Twig blocks to define.
377377
For example, if your form theme is simple and you only want to override the
378378
``<input type="integer">`` elements, create this template:
379379

380-
.. code-block:: html+twig
380+
.. code-block:: twig
381381
382382
{# templates/form/my_theme.html.twig #}
383383
{% block integer_widget %}
@@ -429,7 +429,7 @@ you want to apply the theme globally to all forms, define the
429429
430430
If you only want to apply it to some specific forms, use the ``form_theme`` tag:
431431

432-
.. code-block:: html+twig
432+
.. code-block:: twig
433433
434434
{% form_theme form 'form/my_theme.html.twig' %}
435435
@@ -453,7 +453,7 @@ built-in themes using the `Twig "use" tag`_ instead of the ``extends`` tag so
453453
you can inherit all its blocks (if you are unsure, extend from the default
454454
``form_div_layout.html.twig`` theme):
455455

456-
.. code-block:: html+twig
456+
.. code-block:: twig
457457
458458
{# templates/form/my_theme.html.twig #}
459459
{% use 'form_div_layout.html.twig' %}

0 commit comments

Comments
 (0)