|
@@ -145,6 +145,25 @@ There are several ways how you can customize the serialization process:
|
|
|
2. Implementing NormalizableInterface
|
|
|
3. Adding a Custom Normalizer
|
|
|
|
|
|
+Wiring Custom Normalizers/Encoders
|
|
|
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
+
|
|
|
+If you want to add custom normalizers, or encoders, you simply have to implement
|
|
|
+either the ``JMS\SerializerBundle\Serializer\Normalizer\NormalizerInterface`` or
|
|
|
+the ``JMS\SerializerBundle\Serializer\Encoder\EncoderInterface`` interface.
|
|
|
+
|
|
|
+For normalizers, you can then use the following tag:
|
|
|
+
|
|
|
+ <service id="my.custom.normalizer">
|
|
|
+ <tag name="jms_serializer.normalizer" />
|
|
|
+ </service>
|
|
|
+
|
|
|
+For encoders, you also have to pass the format:
|
|
|
+
|
|
|
+ <service id="my.custom.xml.encoder">
|
|
|
+ <tag name="jms_serializer.encoder" format="xml" />
|
|
|
+ </service>
|
|
|
+
|
|
|
Annotations
|
|
|
-----------
|
|
|
|