Skip to content

Commit 8d99047

Browse files
author
Henry Snoek
committed
example for processing XML comments when decoding
1 parent 001f5dd commit 8d99047

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

components/serializer.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,27 @@ always as a collection.
704704
.. versionadded:: 4.1
705705
The ``as_collection`` option was introduced in Symfony 4.1.
706706

707+
.. tip::
708+
709+
Processing of XML comments can be controlled with the third constructor
710+
argument:
711+
712+
.. code-block:: php
713+
714+
class XmlEncoder
715+
{
716+
public function __construct(
717+
string $rootNodeName = 'response',
718+
int $loadOptions = null,
719+
array $ignoredNodeTypes = array(XML_PI_NODE, XML_COMMENT_NODE)
720+
) {
721+
// ...
722+
}
723+
}
724+
725+
.. versionadded:: 4.1
726+
XML comments are removed by default since Symfony 4.1.
727+
707728
The ``YamlEncoder``
708729
~~~~~~~~~~~~~~~~~~~
709730

0 commit comments

Comments
 (0)