@@ -30,11 +30,11 @@ render
30
30
31
31
.. code-block :: twig
32
32
33
- {{ render(uri, options) }}
33
+ {{ render(uri, options = [] ) }}
34
34
35
35
``uri ``
36
36
**type **: ``string `` | ``ControllerReference ``
37
- ``options ``
37
+ ``options `` * (optional) *
38
38
**type **: ``array `` **default **: ``[] ``
39
39
40
40
Renders the fragment for the given controller (using the `controller `_ function)
@@ -53,11 +53,11 @@ render_esi
53
53
54
54
.. code-block :: twig
55
55
56
- {{ render_esi(uri, options) }}
56
+ {{ render_esi(uri, options = [] ) }}
57
57
58
58
``uri ``
59
59
**type **: ``string `` | ``ControllerReference ``
60
- ``options ``
60
+ ``options `` * (optional) *
61
61
**type **: ``array `` **default **: ``[] ``
62
62
63
63
Generates an ESI tag when possible or falls back to the behavior of
@@ -80,13 +80,13 @@ controller
80
80
81
81
.. code-block :: twig
82
82
83
- {{ controller(controller, attributes, query) }}
83
+ {{ controller(controller, attributes = [] , query = [] ) }}
84
84
85
85
``controller ``
86
86
**type **: ``string ``
87
- ``attributes ``
87
+ ``attributes `` * (optional) *
88
88
**type **: ``array `` **default **: ``[] ``
89
- ``query ``
89
+ ``query `` * (optional) *
90
90
**type **: ``array `` **default **: ``[] ``
91
91
92
92
Returns an instance of ``ControllerReference `` to be used with functions
@@ -98,11 +98,11 @@ asset
98
98
99
99
.. code-block :: twig
100
100
101
- {{ asset(path, packageName, absolute = false, version = null) }}
101
+ {{ asset(path, packageName = null , absolute = false, version = null) }}
102
102
103
103
``path ``
104
104
**type **: ``string ``
105
- ``packageName ``
105
+ ``packageName `` * (optional) *
106
106
**type **: ``string `` | ``null `` **default **: ``null ``
107
107
``absolute `` (deprecated as of 2.7)
108
108
**type **: ``boolean `` **default **: ``false ``
@@ -118,9 +118,9 @@ assets_version
118
118
119
119
.. code-block :: twig
120
120
121
- {{ assets_version(packageName) }}
121
+ {{ assets_version(packageName = null ) }}
122
122
123
- ``packageName ``
123
+ ``packageName `` * (optional) *
124
124
**type **: ``string `` | ``null `` **default **: ``null ``
125
125
126
126
Returns the current version of the package, more information in
@@ -131,11 +131,11 @@ form
131
131
132
132
.. code-block :: twig
133
133
134
- {{ form(view, variables) }}
134
+ {{ form(view, variables = [] ) }}
135
135
136
136
``view ``
137
137
**type **: ``FormView ``
138
- ``variables ``
138
+ ``variables `` * (optional) *
139
139
**type **: ``array `` **default **: ``[] ``
140
140
141
141
Renders the HTML of a complete form, more information in
@@ -146,11 +146,11 @@ form_start
146
146
147
147
.. code-block :: twig
148
148
149
- {{ form_start(view, variables) }}
149
+ {{ form_start(view, variables = [] ) }}
150
150
151
151
``view ``
152
152
**type **: ``FormView ``
153
- ``variables ``
153
+ ``variables `` * (optional) *
154
154
**type **: ``array `` **default **: ``[] ``
155
155
156
156
Renders the HTML start tag of a form, more information in
@@ -161,11 +161,11 @@ form_end
161
161
162
162
.. code-block :: twig
163
163
164
- {{ form_end(view, variables) }}
164
+ {{ form_end(view, variables = [] ) }}
165
165
166
166
``view ``
167
167
**type **: ``FormView ``
168
- ``variables ``
168
+ ``variables `` * (optional) *
169
169
**type **: ``array `` **default **: ``[] ``
170
170
171
171
Renders the HTML end tag of a form together with all fields that have not
@@ -191,11 +191,11 @@ form_widget
191
191
192
192
.. code-block :: twig
193
193
194
- {{ form_widget(view, variables) }}
194
+ {{ form_widget(view, variables = [] ) }}
195
195
196
196
``view ``
197
197
**type **: ``FormView ``
198
- ``variables ``
198
+ ``variables `` * (optional) *
199
199
**type **: ``array `` **default **: ``[] ``
200
200
201
201
Renders a complete form or a specific HTML widget of a field, more information
@@ -219,13 +219,13 @@ form_label
219
219
220
220
.. code-block :: twig
221
221
222
- {{ form_label(view, label, variables) }}
222
+ {{ form_label(view, label = null , variables = [] ) }}
223
223
224
224
``view ``
225
225
**type **: ``FormView ``
226
- ``label ``
226
+ ``label `` * (optional) *
227
227
**type **: ``string `` **default **: ``null ``
228
- ``variables ``
228
+ ``variables `` * (optional) *
229
229
**type **: ``array `` **default **: ``[] ``
230
230
231
231
Renders the label for the given field, more information in
@@ -236,11 +236,11 @@ form_row
236
236
237
237
.. code-block :: twig
238
238
239
- {{ form_row(view, variables) }}
239
+ {{ form_row(view, variables = [] ) }}
240
240
241
241
``view ``
242
242
**type **: ``FormView ``
243
- ``variables ``
243
+ ``variables `` * (optional) *
244
244
**type **: ``array `` **default **: ``[] ``
245
245
246
246
Renders the row (the field's label, errors and widget) of the given field,
@@ -251,11 +251,11 @@ form_rest
251
251
252
252
.. code-block :: twig
253
253
254
- {{ form_rest(view, variables) }}
254
+ {{ form_rest(view, variables = [] ) }}
255
255
256
256
``view ``
257
257
**type **: ``FormView ``
258
- ``variables ``
258
+ ``variables `` * (optional) *
259
259
**type **: ``array `` **default **: ``[] ``
260
260
261
261
Renders all fields that have not yet been rendered, more information in
@@ -279,13 +279,13 @@ is_granted
279
279
280
280
.. code-block :: twig
281
281
282
- {{ is_granted(role, object, field) }}
282
+ {{ is_granted(role, object = null , field = null ) }}
283
283
284
284
``role ``
285
285
**type **: ``string ``
286
- ``object ``
286
+ ``object `` * (optional) *
287
287
**type **: ``object ``
288
- ``field ``
288
+ ``field `` * (optional) *
289
289
**type **: ``string ``
290
290
291
291
Returns ``true `` if the current user has the required role. Optionally,
@@ -302,21 +302,22 @@ logout_path
302
302
303
303
.. code-block :: twig
304
304
305
- {{ logout_path(key) }}
305
+ {{ logout_path(key = null ) }}
306
306
307
- ``key ``
307
+ ``key `` * (optional) *
308
308
**type **: ``string ``
309
309
310
- Generates a relative logout URL for the given firewall.
310
+ Generates a relative logout URL for the given firewall. If no key is provided,
311
+ the URL is generated for the current firewall the user is logged into.
311
312
312
313
logout_url
313
314
~~~~~~~~~~
314
315
315
316
.. code-block :: twig
316
317
317
- {{ logout_url(key) }}
318
+ {{ logout_url(key = null ) }}
318
319
319
- ``key ``
320
+ ``key `` * (optional) *
320
321
**type **: ``string ``
321
322
322
323
Equal to the `logout_path `_ function, but it'll generate an absolute URL
@@ -327,13 +328,13 @@ path
327
328
328
329
.. code-block :: twig
329
330
330
- {{ path(name, parameters, relative) }}
331
+ {{ path(name, parameters = [] , relative = false ) }}
331
332
332
333
``name ``
333
334
**type **: ``string ``
334
- ``parameters ``
335
+ ``parameters `` * (optional) *
335
336
**type **: ``array `` **default **: ``[] ``
336
- ``relative ``
337
+ ``relative `` * (optional) *
337
338
**type **: ``boolean `` **default **: ``false ``
338
339
339
340
Returns the relative URL (without the scheme and host) for the given route.
@@ -345,13 +346,13 @@ url
345
346
346
347
.. code-block :: twig
347
348
348
- {{ url(name, parameters, schemeRelative) }}
349
+ {{ url(name, parameters = [] , schemeRelative = false ) }}
349
350
350
351
``name ``
351
352
**type **: ``string ``
352
- ``parameters ``
353
+ ``parameters `` * (optional) *
353
354
**type **: ``array `` **default **: ``[] ``
354
- ``schemeRelative ``
355
+ ``schemeRelative `` * (optional) *
355
356
**type **: ``boolean `` **default **: ``false ``
356
357
357
358
Returns the absolute URL (with scheme and host) for the given route. If
@@ -432,15 +433,15 @@ trans
432
433
433
434
.. code-block :: twig
434
435
435
- {{ message|trans(arguments, domain, locale) }}
436
+ {{ message|trans(arguments = [] , domain = null , locale = null ) }}
436
437
437
438
``message ``
438
439
**type **: ``string ``
439
- ``arguments ``
440
+ ``arguments `` * (optional) *
440
441
**type **: ``array `` **default **: ``[] ``
441
- ``domain ``
442
+ ``domain `` * (optional) *
442
443
**type **: ``string `` **default **: ``null ``
443
- ``locale ``
444
+ ``locale `` * (optional) *
444
445
**type **: ``string `` **default **: ``null ``
445
446
446
447
Translates the text into the current language. More information in
@@ -451,17 +452,17 @@ transchoice
451
452
452
453
.. code-block :: twig
453
454
454
- {{ message|transchoice(count, arguments, domain, locale) }}
455
+ {{ message|transchoice(count, arguments = [] , domain = null , locale = null ) }}
455
456
456
457
``message ``
457
458
**type **: ``string ``
458
459
``count ``
459
460
**type **: ``integer ``
460
- ``arguments ``
461
+ ``arguments `` * (optional) *
461
462
**type **: ``array `` **default **: ``[] ``
462
- ``domain ``
463
+ ``domain `` * (optional) *
463
464
**type **: ``string `` **default **: ``null ``
464
- ``locale ``
465
+ ``locale `` * (optional) *
465
466
**type **: ``string `` **default **: ``null ``
466
467
467
468
Translates the text with pluralization support. More information in
@@ -472,13 +473,13 @@ yaml_encode
472
473
473
474
.. code-block :: twig
474
475
475
- {{ input|yaml_encode(inline, dumpObjects) }}
476
+ {{ input|yaml_encode(inline = 0 , dumpObjects = false ) }}
476
477
477
478
``input ``
478
479
**type **: ``mixed ``
479
- ``inline ``
480
+ ``inline `` * (optional) *
480
481
**type **: ``integer `` **default **: ``0 ``
481
- ``dumpObjects ``
482
+ ``dumpObjects `` * (optional) *
482
483
**type **: ``boolean `` **default **: ``false ``
483
484
484
485
Transforms the input into YAML syntax. See :ref: `components-yaml-dump ` for
@@ -489,13 +490,13 @@ yaml_dump
489
490
490
491
.. code-block :: twig
491
492
492
- {{ value|yaml_dump(inline, dumpObjects) }}
493
+ {{ value|yaml_dump(inline = 0 , dumpObjects = false ) }}
493
494
494
495
``value ``
495
496
**type **: ``mixed ``
496
- ``inline ``
497
+ ``inline `` * (optional) *
497
498
**type **: ``integer `` **default **: ``0 ``
498
- ``dumpObjects ``
499
+ ``dumpObjects `` * (optional) *
499
500
**type **: ``boolean `` **default **: ``false ``
500
501
501
502
Does the same as `yaml_encode() <yaml_encode >`_, but includes the type in
@@ -557,11 +558,11 @@ file_excerpt
557
558
558
559
.. code-block :: twig
559
560
560
- {{ file|file_excerpt(line) }}
561
+ {{ file|file_excerpt(line = null ) }}
561
562
562
563
``file ``
563
564
**type **: ``string ``
564
- ``line ``
565
+ ``line `` * (optional) *
565
566
**type **: ``integer ``
566
567
567
568
Generates an excerpt of seven lines around the given ``line ``.
@@ -571,13 +572,13 @@ format_file
571
572
572
573
.. code-block :: twig
573
574
574
- {{ file|format_file(line, text) }}
575
+ {{ file|format_file(line, text = null ) }}
575
576
576
577
``file ``
577
578
**type **: ``string ``
578
579
``line ``
579
580
**type **: ``integer ``
580
- ``text ``
581
+ ``text `` * (optional) *
581
582
**type **: ``string `` **default **: ``null ``
582
583
583
584
Generates the file path inside an ``<a> `` element. If the path is inside
@@ -601,9 +602,9 @@ file_link
601
602
602
603
.. code-block :: twig
603
604
604
- {{ file|file_link(line) }}
605
+ {{ file|file_link(line = null ) }}
605
606
606
- ``line ``
607
+ ``line `` * (optional) *
607
608
**type **: ``integer ``
608
609
609
610
Generates a link to the provided file (and optionally line number) using
@@ -637,11 +638,11 @@ trans
637
638
638
639
{% trans with vars from domain into locale %}{% endtrans %}
639
640
640
- ``vars ``
641
+ ``vars `` * (optional) *
641
642
**type **: ``array `` **default **: ``[] ``
642
- ``domain ``
643
+ ``domain `` * (optional) *
643
644
**type **: ``string `` **default **: ``string ``
644
- ``locale ``
645
+ ``locale `` * (optional) *
645
646
**type **: ``string `` **default **: ``string ``
646
647
647
648
Renders the translation of the content. More information in :ref: `book-translation-tags `.
@@ -655,11 +656,11 @@ transchoice
655
656
656
657
``count ``
657
658
**type **: ``integer ``
658
- ``vars ``
659
+ ``vars `` * (optional) *
659
660
**type **: ``array `` **default **: ``[] ``
660
- ``domain ``
661
+ ``domain `` * (optional) *
661
662
**type **: ``string `` **default **: ``null ``
662
- ``locale ``
663
+ ``locale `` * (optional) *
663
664
**type **: ``string `` **default **: ``null ``
664
665
665
666
Renders the translation of the content with pluralization support, more
0 commit comments