Skip to content

Commit 7618fb7

Browse files
committed
Merge branch '6.0' into 6.1
* 6.0: Update serializer.rst
2 parents dba896b + c69ec43 commit 7618fb7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

components/serializer.rst

+5-2
Original file line numberDiff line numberDiff line change
@@ -1080,8 +1080,11 @@ always as a collection.
10801080
behavior can be changed with the optional context key ``XmlEncoder::DECODER_IGNORED_NODE_TYPES``.
10811081

10821082
Data with ``#comment`` keys are encoded to XML comments by default. This can be
1083-
changed with the optional ``$encoderIgnoredNodeTypes`` argument of the
1084-
``XmlEncoder`` class constructor.
1083+
changed by adding the ``\XML_COMMENT_NODE`` option to the ``XmlEncoder::ENCODER_IGNORED_NODE_TYPES``
1084+
key of the ``$defaultContext`` of the ``XmlEncoder`` constructor or
1085+
directly to the ``$context`` argument of the ``encode()`` method::
1086+
1087+
$xmlEncoder->encode($array, 'xml', [XmlEncoder::ENCODER_IGNORED_NODE_TYPES => [\XML_COMMENT_NODE]]);
10851088

10861089
The ``XmlEncoder`` Context Options
10871090
..................................

0 commit comments

Comments
 (0)