@@ -34,11 +34,11 @@ render
34
34
35
35
.. code-block :: twig
36
36
37
- {{ render(uri, options) }}
37
+ {{ render(uri, options = [] ) }}
38
38
39
39
``uri ``
40
40
**type **: ``string `` | ``ControllerReference ``
41
- ``options ``
41
+ ``options `` * (optional) *
42
42
**type **: ``array `` **default **: ``[] ``
43
43
44
44
Renders the fragment for the given controller (using the `controller `_ function)
@@ -57,11 +57,11 @@ render_esi
57
57
58
58
.. code-block :: twig
59
59
60
- {{ render_esi(uri, options) }}
60
+ {{ render_esi(uri, options = [] ) }}
61
61
62
62
``uri ``
63
63
**type **: ``string `` | ``ControllerReference ``
64
- ``options ``
64
+ ``options `` * (optional) *
65
65
**type **: ``array `` **default **: ``[] ``
66
66
67
67
Generates an ESI tag when possible or falls back to the behavior of
@@ -87,13 +87,13 @@ controller
87
87
88
88
.. code-block :: twig
89
89
90
- {{ controller(controller, attributes, query) }}
90
+ {{ controller(controller, attributes = [] , query = [] ) }}
91
91
92
92
``controller ``
93
93
**type **: ``string ``
94
- ``attributes ``
94
+ ``attributes `` * (optional) *
95
95
**type **: ``array `` **default **: ``[] ``
96
- ``query ``
96
+ ``query `` * (optional) *
97
97
**type **: ``array `` **default **: ``[] ``
98
98
99
99
Returns an instance of ``ControllerReference `` to be used with functions
@@ -105,11 +105,11 @@ asset
105
105
106
106
.. code-block :: twig
107
107
108
- {{ asset(path, packageName) }}
108
+ {{ asset(path, packageName = null ) }}
109
109
110
110
``path ``
111
111
**type **: ``string ``
112
- ``packageName ``
112
+ ``packageName `` * (optional) *
113
113
**type **: ``string `` | ``null `` **default **: ``null ``
114
114
115
115
Returns a public path to ``path ``, which takes into account the base path
@@ -121,9 +121,9 @@ assets_version
121
121
122
122
.. code-block :: twig
123
123
124
- {{ assets_version(packageName) }}
124
+ {{ assets_version(packageName = null ) }}
125
125
126
- ``packageName ``
126
+ ``packageName `` * (optional) *
127
127
**type **: ``string `` | ``null `` **default **: ``null ``
128
128
129
129
Returns the current version of the package, more information in
@@ -134,11 +134,11 @@ form
134
134
135
135
.. code-block :: twig
136
136
137
- {{ form(view, variables) }}
137
+ {{ form(view, variables = [] ) }}
138
138
139
139
``view ``
140
140
**type **: ``FormView ``
141
- ``variables ``
141
+ ``variables `` * (optional) *
142
142
**type **: ``array `` **default **: ``[] ``
143
143
144
144
Renders the HTML of a complete form, more information in
@@ -149,11 +149,11 @@ form_start
149
149
150
150
.. code-block :: twig
151
151
152
- {{ form_start(view, variables) }}
152
+ {{ form_start(view, variables = [] ) }}
153
153
154
154
``view ``
155
155
**type **: ``FormView ``
156
- ``variables ``
156
+ ``variables `` * (optional) *
157
157
**type **: ``array `` **default **: ``[] ``
158
158
159
159
Renders the HTML start tag of a form, more information in
@@ -164,11 +164,11 @@ form_end
164
164
165
165
.. code-block :: twig
166
166
167
- {{ form_end(view, variables) }}
167
+ {{ form_end(view, variables = [] ) }}
168
168
169
169
``view ``
170
170
**type **: ``FormView ``
171
- ``variables ``
171
+ ``variables `` * (optional) *
172
172
**type **: ``array `` **default **: ``[] ``
173
173
174
174
Renders the HTML end tag of a form together with all fields that have not
@@ -194,11 +194,11 @@ form_widget
194
194
195
195
.. code-block :: twig
196
196
197
- {{ form_widget(view, variables) }}
197
+ {{ form_widget(view, variables = [] ) }}
198
198
199
199
``view ``
200
200
**type **: ``FormView ``
201
- ``variables ``
201
+ ``variables `` * (optional) *
202
202
**type **: ``array `` **default **: ``[] ``
203
203
204
204
Renders a complete form or a specific HTML widget of a field, more information
@@ -222,13 +222,13 @@ form_label
222
222
223
223
.. code-block :: twig
224
224
225
- {{ form_label(view, label, variables) }}
225
+ {{ form_label(view, label = null , variables = [] ) }}
226
226
227
227
``view ``
228
228
**type **: ``FormView ``
229
- ``label ``
229
+ ``label `` * (optional) *
230
230
**type **: ``string `` **default **: ``null ``
231
- ``variables ``
231
+ ``variables `` * (optional) *
232
232
**type **: ``array `` **default **: ``[] ``
233
233
234
234
Renders the label for the given field, more information in
@@ -239,11 +239,11 @@ form_row
239
239
240
240
.. code-block :: twig
241
241
242
- {{ form_row(view, variables) }}
242
+ {{ form_row(view, variables = [] ) }}
243
243
244
244
``view ``
245
245
**type **: ``FormView ``
246
- ``variables ``
246
+ ``variables `` * (optional) *
247
247
**type **: ``array `` **default **: ``[] ``
248
248
249
249
Renders the row (the field's label, errors and widget) of the given field,
@@ -254,11 +254,11 @@ form_rest
254
254
255
255
.. code-block :: twig
256
256
257
- {{ form_rest(view, variables) }}
257
+ {{ form_rest(view, variables = [] ) }}
258
258
259
259
``view ``
260
260
**type **: ``FormView ``
261
- ``variables ``
261
+ ``variables `` * (optional) *
262
262
**type **: ``array `` **default **: ``[] ``
263
263
264
264
Renders all fields that have not yet been rendered, more information in
@@ -282,13 +282,13 @@ is_granted
282
282
283
283
.. code-block :: twig
284
284
285
- {{ is_granted(role, object, field) }}
285
+ {{ is_granted(role, object = null , field = null ) }}
286
286
287
287
``role ``
288
288
**type **: ``string ``
289
- ``object ``
289
+ ``object `` * (optional) *
290
290
**type **: ``object ``
291
- ``field ``
291
+ ``field `` * (optional) *
292
292
**type **: ``string ``
293
293
294
294
Returns ``true `` if the current user has the required role. Optionally,
@@ -305,21 +305,22 @@ logout_path
305
305
306
306
.. code-block :: twig
307
307
308
- {{ logout_path(key) }}
308
+ {{ logout_path(key = null ) }}
309
309
310
- ``key ``
310
+ ``key `` * (optional) *
311
311
**type **: ``string ``
312
312
313
- Generates a relative logout URL for the given firewall.
313
+ Generates a relative logout URL for the given firewall. If no key is provided,
314
+ the URL is generated for the current firewall the user is logged into.
314
315
315
316
logout_url
316
317
~~~~~~~~~~
317
318
318
319
.. code-block :: twig
319
320
320
- {{ logout_url(key) }}
321
+ {{ logout_url(key = null ) }}
321
322
322
- ``key ``
323
+ ``key `` * (optional) *
323
324
**type **: ``string ``
324
325
325
326
Equal to the `logout_path `_ function, but it'll generate an absolute URL
@@ -330,13 +331,13 @@ path
330
331
331
332
.. code-block :: twig
332
333
333
- {{ path(name, parameters, relative) }}
334
+ {{ path(name, parameters = [] , relative = false ) }}
334
335
335
336
``name ``
336
337
**type **: ``string ``
337
- ``parameters ``
338
+ ``parameters `` * (optional) *
338
339
**type **: ``array `` **default **: ``[] ``
339
- ``relative ``
340
+ ``relative `` * (optional) *
340
341
**type **: ``boolean `` **default **: ``false ``
341
342
342
343
Returns the relative URL (without the scheme and host) for the given route.
@@ -348,13 +349,13 @@ url
348
349
349
350
.. code-block :: twig
350
351
351
- {{ url(name, parameters, schemeRelative) }}
352
+ {{ url(name, parameters = [] , schemeRelative = false ) }}
352
353
353
354
``name ``
354
355
**type **: ``string ``
355
- ``parameters ``
356
+ ``parameters `` * (optional) *
356
357
**type **: ``array `` **default **: ``[] ``
357
- ``schemeRelative ``
358
+ ``schemeRelative `` * (optional) *
358
359
**type **: ``boolean `` **default **: ``false ``
359
360
360
361
Returns the absolute URL (with scheme and host) for the given route. If
@@ -392,15 +393,15 @@ trans
392
393
393
394
.. code-block :: twig
394
395
395
- {{ messag
179B
e|trans(arguments, domain, locale) }}
396
+ {{ message|trans(arguments = [] , domain = null , locale = null ) }}
396
397
397
398
``message ``
398
399
**type **: ``string ``
399
- ``arguments ``
400
+ ``arguments `` * (optional) *
400
401
**type **: ``array `` **default **: ``[] ``
401
- ``domain ``
402
+ ``domain `` * (optional) *
402
403
**type **: ``string `` **default **: ``null ``
403
- ``locale ``
404
+ ``locale `` * (optional) *
404
405
**type **: ``string `` **default **: ``null ``
405
406
406
407
Translates the text into the current language. More information in
@@ -411,17 +412,17 @@ transchoice
411
412
412
413
.. code-block :: twig
413
414
414
- {{ message|transchoice(count, arguments, domain, locale) }}
415
+ {{ message|transchoice(count, arguments = [] , domain = null , locale = null ) }}
415
416
416
417
``message ``
417
418
**type **: ``string ``
418
419
``count ``
419
420
**type **: ``integer ``
420
- ``arguments ``
421
+ ``arguments `` * (optional) *
421
422
**type **: ``array `` **default **: ``[] ``
422
- ``domain ``
423
+ ``domain `` * (optional) *
423
424
**type **: ``string `` **default **: ``null ``
424
- ``locale ``
425
+ ``locale `` * (optional) *
425
426
**type **: ``string `` **default **: ``null ``
426
427
427
428
Translates the text with pluralization support. More information in
@@ -432,13 +433,13 @@ yaml_encode
432
433
433
434
.. code-block :: twig
434
435
435
- {{ input|yaml_encode(inline, dumpObjects) }}
436
+ {{ input|yaml_encode(inline = 0 , dumpObjects = false ) }}
436
437
437
438
``input ``
438
439
**type **: ``mixed ``
439
- ``inline ``
440
+ ``inline `` * (optional) *
440
441
**type **: ``integer `` **default **: ``0 ``
10000
441
- ``dumpObjects ``
442
+ ``dumpObjects `` * (optional) *
442
443
**type **: ``boolean `` **default **: ``false ``
443
444
444
445
Transforms the input into YAML syntax. See :ref: `components-yaml-dump ` for
@@ -449,13 +450,13 @@ yaml_dump
449
450
450
451
.. code-block :: twig
451
452
452
- {{ value|yaml_dump(inline, dumpObjects) }}
453
+ {{ value|yaml_dump(inline = 0 , dumpObjects = false ) }}
453
454
454
455
``value ``
455
456
**type **: ``mixed ``
456
- ``inline ``
457
+ ``inline `` * (optional) *
457
458
**type **: ``integer `` **default **: ``0 ``
458
- ``dumpObjects ``
459
+ ``dumpObjects `` * (optional) *
459
460
**type **: ``boolean `` **default **: ``false ``
460
461
461
462
Does the same as `yaml_encode() <yaml_encode >`_, but includes the type in
@@ -517,11 +518,11 @@ file_excerpt
517
518
518
519
.. code-block :: twig
519
520
520
- {{ file|file_excerpt(line) }}
521
+ {{ file|file_excerpt(line = null ) }}
521
522
522
523
``file ``
523
524
**type **: ``string ``
524
- ``line ``
525
+ ``line `` * (optional) *
525
526
**type **: ``integer ``
526
527
527
528
Generates an excerpt of seven lines around the given ``line ``.
@@ -531,13 +532,13 @@ format_file
531
532
532
533
.. code-block :: twig
533
534
534
- {{ file|format_file(line, text) }}
535
+ {{ file|format_file(line, text = null ) }}
535
536
536
537
``file ``
537
538
**type **: ``string ``
538
539
``line ``
539
540
**type **: ``integer ``
540
- ``text ``
541
+ ``text `` * (optional) *
541
542
**type **: ``string `` **default **: ``null ``
542
543
543
544
Generates the file path inside an ``<a> `` element. If the path is inside
@@ -561,9 +562,9 @@ file_link
561
562
562
563
.. code-block :: twig
563
564
564
- {{ file|file_link(line) }}
565
+ {{ file|file_link(line = null ) }}
565
566
566
- ``line ``
567
+ ``line `` * (optional) *
567
568
**type **: ``integer ``
568
569
569
570
Generates a link to the provided file (and optionally line number) using
@@ -597,11 +598,11 @@ trans
597
598
598
599
{% trans with vars from domain into locale %}{% endtrans %}
599
600
600
- ``vars ``
601
+ ``vars `` * (optional) *
601
602
**type **: ``array `` **default **: ``[] ``
602
- ``domain ``
603
+ ``domain `` * (optional) *
603
604
**type **: ``string `` **default **: ``string ``
604
- ``locale ``
605
+ ``locale `` * (optional) *
605
606
**type **: ``string `` **default **: ``string ``
606
607
607
608
Renders the translation of the content. More information in :ref: `book-translation-tags `.
@@ -615,11 +616,11 @@ transchoice
615
616
616
617
``count ``
617
618
**type **: ``integer ``
618
- ``vars ``
619
+ ``vars `` * (optional) *
619
620
**type **: ``array `` **default **: ``[] ``
620
- ``domain ``
621
+ ``domain `` * (optional) *
621
622
**type **: ``string `` **default **: ``null ``
622
- ``locale ``
623
+ ``locale `` * (optional) *
623
624
**type **: ``string `` **default **: ``null ``
624
625
625
626
Renders the translation of the content with pluralization support, more
0 commit comments