File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -440,6 +440,34 @@ By default, digit-only array keys are dumped as integers. You can use the
440440 $dumped = Yaml::dump([200 => 'foo'], 2, 4, Yaml::DUMP_NUMERIC_KEY_AS_STRING);
441441 // '200': foo
442442
443+ Dumping Collection of Maps
444+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
445+
446+ By default, the collection of maps uses a hyphen on a separate line as a delimiter.
447+ To use the delimiter line as part of the map dump, use the ``Yaml::DUMP_COMPACT_NESTED_MAPPING `` flag.
448+
449+ Dump without flag set:
450+
451+ .. code-block :: yaml
452+
453+ planets :
454+ -
455+ name : Mercury
456+ distance : 57910000
457+ -
458+ name : Jupiter
459+ distance : 778500000
460+
461+ Dump with ``Yaml::DUMP_COMPACT_NESTED_MAPPING `` flag set:
462+
463+ .. code-block :: yaml
464+
465+ planets :
466+ - name : Mercury
467+ distance : 57910000
468+ - name : Jupiter
469+ distance : 778500000
470+
443471 Syntax Validation
444472~~~~~~~~~~~~~~~~~
445473
You can’t perform that action at this time.
0 commit comments