Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 92c9ea9

Browse filesBrowse files
committed
feature #7654 [Serializer] Document the CsvEncoder and the YamlEncoder (GuilhemN)
This PR was submitted for the 3.2 branch but it was merged into the 3.3 branch instead (closes #7654). Discussion ---------- [Serializer] Document the CsvEncoder and the YamlEncoder Document the CsvEncoder and the YamlEncoder introduced in symfony/symfony#19197 and symfony/symfony#19326. Commits ------- 6944ea1 [Serializer] Document the CsvEncoder and the YamlEncoder
2 parents 55c462e + 6944ea1 commit 92c9ea9
Copy full SHA for 92c9ea9

File tree

1 file changed

+17
-5
lines changed
Filter options

1 file changed

+17
-5
lines changed

‎serializer/encoders.rst

Copy file name to clipboardExpand all lines: serializer/encoders.rst
+17-5Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,23 @@ You can add new encoders to a Serializer instance by using its second constructo
2323
Built-in Encoders
2424
-----------------
2525

26-
Two encoders are used in the example above:
26+
The Serializer component provides built-in encoders:
2727

28-
* :class:`Symfony\\Component\\Serializer\\Encoder\\XmlEncoder` to encode/decode XML
28+
* :class:`Symfony\\Component\\Serializer\\Encoder\\CsvEncoder` to encode/decode CSV
2929
* :class:`Symfony\\Component\\Serializer\\Encoder\\JsonEncoder` to encode/decode JSON
30+
* :class:`Symfony\\Component\\Serializer\\Encoder\\XmlEncoder` to encode/decode XML
31+
* :class:`Symfony\\Component\\Serializer\\Encoder\\YamlEncoder` to encode/decode Yaml
32+
33+
.. versionadded:: 3.2
34+
The :class:`Symfony\\Component\\Serializer\\Encoder\\CsvEncoder` and the
35+
:class:`Symfony\\Component\\Serializer\\Encoder\\YamlEncoder` were added in
36+
Symfony 3.2.
37+
38+
The ``JsonEncoder``
39+
~~~~~~~~~~~~~~~~~~~
40+
41+
The ``JsonEncoder`` is much simpler and is based on the PHP
42+
:phpfunction:`json_encode` and :phpfunction:`json_decode` functions.
3043

3144
The ``XmlEncoder``
3245
~~~~~~~~~~~~~~~~~~
@@ -56,8 +69,7 @@ Be aware that this encoder will consider keys beginning with ``@`` as attributes
5669
// <foo bar="value" />
5770
// </response>
5871

59-
The ``JsonEncoder``
72+
The ``YamlEncoder``
6073
~~~~~~~~~~~~~~~~~~~
6174

62-
The ``JsonEncoder`` is much simpler and is based on the PHP
63-
:phpfunction:`json_encode` and :phpfunction:`json_decode` functions.
75+
This encoder requires the :doc:`Yaml Component </components/yaml>`.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.