Bläddra i källkod

Added usage to documentation

Jonathan Bowers 13 år sedan
förälder
incheckning
a61e50c774
1 ändrade filer med 7 tillägg och 0 borttagningar
  1. 7 0
      Resources/doc/index.rst

+ 7 - 0
Resources/doc/index.rst

@@ -116,6 +116,13 @@ De-/Serializing Objects
 The serializer supports JSON, and XML out-of-the-box, and can also handle
 The serializer supports JSON, and XML out-of-the-box, and can also handle
 many custom XML features (see below).
 many custom XML features (see below).
 
 
+The serializer can also be accessed via a Twig filter and will default to
+"json".
+
+::
+    {{ myObject | serialize | raw }}
+    {{ myObject | serialize('xml') | raw }}
+
 Versioning
 Versioning
 ~~~~~~~~~~
 ~~~~~~~~~~