Skip to content

Commit 259530a

Browse files
committed
Merge branch '6.1' into 6.2
* 6.1: Update serializer.rst
2 parents 7c9e17a + 7618fb7 commit 259530a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

components/serializer.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,8 +1090,11 @@ always as a collection.
10901090
behavior can be changed with the optional context key ``XmlEncoder::DECODER_IGNORED_NODE_TYPES``.
10911091

10921092
Data with ``#comment`` keys are encoded to XML comments by default. This can be
1093-
changed with the optional ``$encoderIgnoredNodeTypes`` argument of the
1094-
``XmlEncoder`` class constructor.
1093+
changed by adding the ``\XML_COMMENT_NODE`` option to the ``XmlEncoder::ENCODER_IGNORED_NODE_TYPES``
1094+
key of the ``$defaultContext`` of the ``XmlEncoder`` constructor or
1095+
directly to the ``$context`` argument of the ``encode()`` method::
1096+
1097+
$xmlEncoder->encode($array, 'xml', [XmlEncoder::ENCODER_IGNORED_NODE_TYPES => [\XML_COMMENT_NODE]]);
10951098

10961099
The ``XmlEncoder`` Context Options
10971100
..................................

0 commit comments

Comments
 (0)