We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent608fead commita06ad9aCopy full SHA for a06ad9a
components/serializer.rst
@@ -181,15 +181,15 @@ method on the normalizer definition::
181
As a final result, the deserializer uses the ``first_name`` attribute as if
182
it were ``firstName`` and uses the ``getFirstName`` and ``setFirstName`` methods.
183
184
-Using Callbacks to Serialize PropertiesWith Object Instances
+Using Callbacks to Serialize Propertieswith Object Instances
185
-------------------------------------------------------------
186
187
-When serializing you can set a callback to format a specific object property.
+When serializing, you can set a callback to format a specific object property::
188
189
+ use Acme\Person;
190
use Symfony\Component\Serializer\Encoder\JsonEncoder;
191
use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer;
192
use Symfony\Component\Serializer\Serializer;
- use Acme\Person;
193
194
$encoder = new JsonEncoder();
195
$normalizer = new GetSetMethodNormalizer();