We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5266709 commit c5e5831Copy full SHA for c5e5831
reference/twig_reference.rst
@@ -558,6 +558,26 @@ project's root directory:
558
If the given file path is out of the project directory, a ``null`` value
559
will be returned.
560
561
+serialize
562
+~~~~~~~~~
563
+
564
+.. code-block:: twig
565
566
+ {{ object|serialize(format = 'json') }}
567
568
+``object``
569
+ **type**: ``object``
570
571
+``format`` *(optional)*
572
+ **type**: ``string``
573
574
+.. versionadded:: 5.3
575
576
+ The ``serialize`` filter was introduced in Symfony 5.3.
577
578
+Accepts any object that can be serialized by Symfony's Serializer Component and
579
+returns the serialized object in the specified ``format``.
580
581
.. _reference-twig-tags:
582
583
Tags
0 commit comments