public static function Yaml::dump

Dumps a PHP array to a YAML string.

The dump method, when supplied with an array, will do its best to convert the array into friendly YAML.

@api

Parameters

array $array PHP array:

integer $inline The level where you switch to inline YAML:

integer $indent The amount of spaces to use for indentation of nested nodes.:

Return value

string A YAML string representing the original PHP array

1 call to Yaml::dump()
YamlTest::testParseAndDump in drupal/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/YamlTest.php

File

drupal/core/vendor/symfony/yaml/Symfony/Component/Yaml/Yaml.php, line 106

Class

Yaml
Yaml offers convenience methods to load and dump YAML.

Namespace

Symfony\Component\Yaml

Code

public static function dump($array, $inline = 2, $indent = 4) {
  $yaml = new Dumper();
  $yaml
    ->setIndentation($indent);
  return $yaml
    ->dump($array, $inline);
}