diff --git a/cookbook/serializer.rst b/cookbook/serializer.rst index 1f578cd3738..8d77c322701 100644 --- a/cookbook/serializer.rst +++ b/cookbook/serializer.rst @@ -6,13 +6,11 @@ How to Use the Serializer Serializing and deserializing to and from objects and different formats (e.g. JSON or XML) is a very complex topic. Symfony comes with a -:doc:`Serializer Component`, which gives you some +:doc:`Serializer Component `, which gives you some tools that you can leverage for your solution. In fact, before you start, get familiar with the serializer, normalizers -and encoders by reading the :doc:`Serializer Component`. -You should also check out the `JMSSerializerBundle`_, which expands on the -functionality offered by Symfony's core serializer. +and encoders by reading the :doc:`Serializer Component `. Activating the Serializer ------------------------- @@ -56,15 +54,15 @@ Adding Normalizers and Encoders ------------------------------- Once enabled, the ``serializer`` service will be available in the container -and will be loaded with two :ref:`encoders` +and will be loaded with two :ref:`encoders ` (:class:`Symfony\\Component\\Serializer\\Encoder\\JsonEncoder` and :class:`Symfony\\Component\\Serializer\\Encoder\\XmlEncoder`) -but no :ref:`normalizers`, meaning you'll +but no :ref:`normalizers `, meaning you'll need to load your own. You can load normalizers and/or encoders by tagging them as -:ref:`serializer.normalizer` and -:ref:`serializer.encoder`. It's also +:ref:`serializer.normalizer ` and +:ref:`serializer.encoder `. It's also possible to set the priority of the tag in order to decide the matching order. Here is an example on how to load the @@ -100,5 +98,3 @@ Here is an example on how to load the )); $definition->addTag('serializer.normalizer'); $container->setDefinition('get_set_method_normalizer', $definition); - -.. _JMSSerializerBundle: http://jmsyst.com/bundles/JMSSerializerBundle