Skip to content

Commit

Permalink
Added note on YAML mappings as objects
Browse files Browse the repository at this point in the history
  • Loading branch information
dantleech committed May 21, 2016
1 parent 330d40d commit 35f85e4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions components/yaml/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,16 @@ error if something goes wrong by adding the filename to the message.

.. _components-yaml-dump:

Objects for Mappings
....................

Yaml :ref:`mappings <yaml-format-collections>` are basically associative arrays. You can instruct the parser to return
mappings as objects (i.e. ``\stdClass`` instances)::

$object = Yaml::parse('{"hello": "world"}', false, false, true);
echo get_class($object); // stdClass
echo $object->hello; // world

Writing YAML Files
~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 2 additions & 0 deletions components/yaml/yaml_format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ YAML uses the ISO-8601 standard to express dates:
# simple date
2002-12-14
.. _yaml-format-collections:

Collections
-----------

Expand Down

0 comments on commit 35f85e4

Please sign in to comment.