Explorar o código

Merge pull request #76 from mvrhov/doc_override

Add documentation on how to override class metadata
Johannes %!s(int64=13) %!d(string=hai) anos
pai
achega
11e3126ee4
Modificáronse 1 ficheiros con 16 adicións e 0 borrados
  1. 16 0
      Resources/doc/index.rst

+ 16 - 0
Resources/doc/index.rst

@@ -122,6 +122,22 @@ The serializer can also be accessed via a Twig filter and will default to
     {{ myObject | serialize | raw }}
     {{ myObject | serialize('xml') | raw }}
 
+Overriding Metadata
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Sometimes you need to override the metadata for a namespace which doesn't have 
+any or one is provided but it doesn't suit your needs. 
+If that is the case then you need to define a different metadata location in a config.
+
+::
+
+    jms_serializer:
+        metadata:
+            directories:
+                FOSUB:
+                    namespace_prefix: FOS\UserBundle
+                    path: %kernel.root_dir%/serializer/FOSUB
+
 Versioning
 ~~~~~~~~~~