芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/rentandbuyrealty.com/pay/vendor/jms/serializer/doc/usage.rst
Usage ===== Serializing Objects ------------------- Most common usage is probably to serialize objects. This can be achieved very easily: .. configuration-block :: .. code-block :: php build(); $serializer->serialize($object, 'json'); $serializer->serialize($object, 'xml'); .. code-block :: jinja {{ object | serialize }} {# uses JSON #} {{ object | serialize('json') }} {{ object | serialize('xml') }} Deserializing Objects --------------------- You can also deserialize objects from their XML, or JSON representation. For example, when accepting data via an API. .. code-block :: php build(); $object = $serializer->deserialize($jsonData, 'MyNamespace\MyObject', 'json');