Skip to content

Commit 5479b7a

Browse files
committed
Merge branch '7.0' into 7.1
* 7.0: [Serializer] Add documentation about a new XmlEncoder CDATA wrapping opt-out context option
2 parents f01cd56 + 97bd669 commit 5479b7a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

components/serializer.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,8 +1199,16 @@ Option Description
11991199
``save_options`` XML saving `options with libxml`_ ``0``
12001200
``remove_empty_tags`` If set to true, removes all empty tags in the ``false``
12011201
generated XML
1202+
``cdata_wrapping`` If set to false, will not wrap any value ``true``
1203+
containing one of the following characters (
1204+
``<``, ``>``, ``&``) in `a CDATA section`_ like
1205+
following: ``<![CDATA[...]]>``
12021206
============================== ================================================= ==========================
12031207

1208+
.. versionadded:: 6.4
1209+
1210+
The `cdata_wrapping` option was introduced in Symfony 6.4.
1211+
12041212
Example with custom ``context``::
12051213

12061214
use Symfony\Component\Serializer\Encoder\XmlEncoder;
@@ -1920,3 +1928,4 @@ Learn more
19201928
.. _`data URI`: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
19211929
.. _seld/jsonlint: https://github.com/Seldaek/jsonlint
19221930
.. _$flags: https://www.php.net/manual/en/json.constants.php
1931+
.. _`a CDATA section`: https://en.wikipedia.org/wiki/CDATA

0 commit comments

Comments
 (0)