File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -563,20 +563,23 @@ serialize
563
563
564
564
.. code-block :: twig
565
565
566
- {{ object|serialize(format = 'json') }}
566
+ {{ object|serialize(format = 'json', context = [] ) }}
567
567
568
568
``object ``
569
- **type **: ``object ``
569
+ **type **: ``mixed ``
570
570
571
571
``format `` *(optional) *
572
572
**type **: ``string ``
573
573
574
+ ``context `` *(optional) *
575
+ **type **: ``array ``
576
+
574
577
.. versionadded :: 5.3
575
578
576
579
The ``serialize `` filter was introduced in Symfony 5.3.
577
580
578
- Accepts any object that can be serialized by Symfony's Serializer Component and
579
- returns the serialized object in the specified ``format ``.
581
+ Accepts any data that can be serialized by Symfony's Serializer Component and
582
+ returns a serialized string in the specified ``format ``.
580
583
581
584
.. _reference-twig-tags :
582
585
You can’t perform that action at this time.
0 commit comments