You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/serializer/encoders.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,8 @@
4
4
Encoders
5
5
========
6
6
7
-
Encoders basically turn **arrays** into specific **formats** and vice versa.
8
-
They implement :class:`Symfony\\Component\\Serializer\\Encoder\\EncoderInterface` for encoding (arrays to specific formats) and :class:`Symfony\\Component\\Serializer\\Encoder\\DecoderInterface` for decoding (specific formats to arrays).
7
+
Encoders basically turn **arrays** into **formats** and vice versa.
8
+
They implement :class:`Symfony\\Component\\Serializer\\Encoder\\EncoderInterface` for encoding (array to format) and :class:`Symfony\\Component\\Serializer\\Encoder\\DecoderInterface` for decoding (format to array).
9
9
10
10
You can add new encoders to a Serializer instance by using its second constructor argument::
Copy file name to clipboardExpand all lines: components/serializer/normalizers.rst
+18Lines changed: 18 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3,3 +3,21 @@
3
3
4
4
Normalizers
5
5
===========
6
+
7
+
Normalizers turn **objects** into **arrays** and vice-versa.
8
+
They implement :class:`Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface` for normalizing (object to array) and :class:`Symfony\\Component\\Serializer\\Normalizer\\DenormalizerInterface` for denormalizing (array to object).
9
+
10
+
You can add new normalizers to a Serializer instance by using its first constructor argument::
11
+
12
+
use Symfony\Component\Serializer\Serializer;
13
+
use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer;
14
+
use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer;
15
+
16
+
$normalizers = array(new ArrayDenormalizer(), new GetSetMethodNormalizer());
17
+
$serializer = new Serializer($normalizers);
18
+
19
+
Built-in encoders
20
+
-----------------
21
+
22
+
The Serializer Component provides several normalizers for most use cases:
0 commit comments