Browse Source

Improve serialization example

Tom Van Looy 12 năm trước cách đây
mục cha
commit
fc3d97591a
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      doc/index.rst

+ 2 - 1
doc/index.rst

@@ -30,7 +30,8 @@ Usage
 For standalone projects usage of the provided builder is encouraged::
 
     $serializer = JMS\Serializer\SerializerBuilder::create()->build();
-    $serializer->serialize($data, 'json');
+    $jsonContent = $serializer->serialize($data, 'json');
+    echo $jsonContent; // or return it in a Response
 
 Documentation
 -------------