File tree 1 file changed +18
-6
lines changed
1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,23 @@ You can add new encoders to a Serializer instance by using its second constructo
23
23
Built-in Encoders
24
24
-----------------
25
25
26
- Two encoders are used in the example above :
26
+ The Serializer component provides built- in encoders :
27
27
28
- * :class: `Symfony\\ Component\\ Serializer\\ Encoder\\ XmlEncoder ` to encode/decode XML
28
+ * :class: `Symfony\\ Component\\ Serializer\\ Encoder\\ CsvEncoder ` to encode/decode CSV
29
29
* :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.
30
43
31
44
The ``XmlEncoder ``
32
45
~~~~~~~~~~~~~~~~~~
@@ -56,8 +69,7 @@ Be aware that this encoder will consider keys beginning with ``@`` as attributes
56
69
// <foo bar="value" />
57
70
// </response>
58
71
59
- The ``JsonEncoder ``
60
- ~~~~~~~~~~~~~~~~~~~
72
+ The ``YamlEncoder ``
73
+ ~~~~~~~~~~~~~~~~~~
61
74
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 >`.
You can’t perform that action at this time.
0 commit comments