Skip to content

Commit 8e8ce65

Browse files
ktherageOskarStark
andauthored
Update components/serializer.rst
Co-authored-by: Oskar Stark <[email protected]>
1 parent 596e2e0 commit 8e8ce65

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

components/serializer.rst

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,9 +1099,7 @@ always as a collection.
10991099

11001100
.. note::
11011101

1102-
You may need to add some attributes on the root node. This can be done this way :
1103-
1104-
.. code-block:: php
1102+
You may need to add some attributes on the root node::
11051103

11061104
$encoder = new XmlEncoder();
11071105
$encoder->encode([
@@ -1110,16 +1108,11 @@ always as a collection.
11101108
'#' => ['foo' => ['@bar' => 'value', '#' => 'baz']]
11111109
], 'xml');
11121110

1113-
This will generate the following XML :
1114-
1115-
.. code-block:: xml
1116-
1117-
<?xml version="1.0"?>
1118-
<response attribute1="foo" attribute2="bar">
1119-
<foo bar="value">
1120-
baz
1121-
</foo>
1122-
</response>
1111+
// will return:
1112+
// <?xml version="1.0"?>
1113+
// <response attribute1="foo" attribute2="bar">
1114+
// <foo bar="value">baz</foo>
1115+
// </response>
11231116

11241117
.. tip::
11251118

0 commit comments

Comments
 (0)