Skip to content

Commit cb08b46

Browse files
committed
feature #18155 [Serializer] Add documentation about a new XmlEncoder CDATA wrapping opt-out context option (AndoniLarz)
This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [Serializer] Add documentation about a new XmlEncoder CDATA wrapping opt-out context option Add documentation of symfony/symfony#49893 which has been merged in 6.4. TODO : - [x] Fix conflicts (by rebasing) - [x] Edit the context option name (`enable_cdata_wrapping` => `cdata_wrapping`) - [x] Wait for the reviews Commits ------- 705d5d2 [Serializer] Add documentation about a new XmlEncoder CDATA wrapping opt-out context option
2 parents 13ec7f9 + 705d5d2 commit cb08b46

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
@@ -1206,8 +1206,16 @@ Option Description
12061206
``save_options`` XML saving `options with libxml`_ ``0``
12071207
``remove_empty_tags`` If set to true, removes all empty tags in the ``false``
12081208
generated XML
1209+
``cdata_wrapping`` If set to false, will not wrap any value ``true``
1210+
containing one of the following characters (
1211+
``<``, ``>``, ``&``) in `a CDATA section`_ like
1212+
following: ``<![CDATA[...]]>``
12091213
============================== ================================================= ==========================
12101214

1215+
.. versionadded:: 6.4
1216+
1217+
The `cdata_wrapping` option was introduced in Symfony 6.4.
1218+
12111219
Example with custom ``context``::
12121220

12131221
use Symfony\Component\Serializer\Encoder\XmlEncoder;
@@ -1936,3 +1944,4 @@ Learn more
19361944
.. _`data URI`: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
19371945
.. _seld/jsonlint: https://github.com/Seldaek/jsonlint
19381946
.. _$flags: https://www.php.net/manual/en/json.constants.php
1947+
.. _`a CDATA section`: https://en.wikipedia.org/wiki/CDATA

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy