Skip to content

Commit c0acfe3

Browse files
committed
updated Twig templates for the new hash syntax
1 parent d0c2610 commit c0acfe3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

guides/forms/view.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ an argument to the ``render`` helper:
305305

306306
.. code-block:: jinja
307307
308-
{{ form.title|render(['class': 'important']) }}
308+
{{ form.title|render({ 'class': 'important' }) }}
309309
310310
.. code-block:: html+php
311311

@@ -320,7 +320,7 @@ representation. You can pass them in the next argument.
320320

321321
.. code-block:: jinja
322322
323-
{{ form.country|render([], ['separator': ' -- Other countries -- ']) }}
323+
{{ form.country|render({}, { 'separator': ' -- Other countries -- ' }) }}
324324
325325
.. code-block:: html+php
326326

@@ -335,7 +335,7 @@ completely change the HTML output of the helper:
335335

336336
.. code-block:: jinja
337337
338-
{{ form.title|render([], [], 'HelloBundle::form.twig') }}
338+
{{ form.title|render({}, {}, 'HelloBundle::form.twig') }}
339339
340340
.. code-block:: html+php
341341

quick_tour/the_view.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ template, use the ``render`` tag:
196196
.. code-block:: jinja
197197
198198
{# src/Application/HelloBundle/Resources/views/Hello/index.twig #}
199-
{% render "HelloBundle:Hello:fancy" with ['name': name, 'color': 'green'] %}
199+
{% render "HelloBundle:Hello:fancy" with { 'name': name, 'color': 'green' } %}
200200
201201
Here, the ``HelloBundle:Hello:fancy`` string refers to the ``fancy`` action of
202202
the ``Hello`` controller, and the argument is used as simulated request path
@@ -227,7 +227,7 @@ updated by changing the configuration:
227227

228228
.. code-block:: jinja
229229
230-
<a href="{% path 'hello' with ['name': 'Thomas'] %}">Greet Thomas!</a>
230+
<a href="{% path 'hello' with { 'name': 'Thomas' } %}">Greet Thomas!</a>
231231
232232
The ``path`` tag takes the route name and an array of parameters as arguments.
233233
The route name is the main key under which routes are referenced and the
@@ -243,7 +243,7 @@ parameters are the values of the placeholders defined in the route pattern:
243243
.. tip::
244244

245245
You can also generate absolute URLs with the ``url`` tag: ``{% url 'hello'
246-
with ['name': 'Thomas'] %}``.
246+
with { 'name': 'Thomas' } %}``.
247247

248248
Using Assets: images, JavaScripts, and stylesheets
249249
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)