October\Rain\Parse\Yaml

Source: ~/vendor/october/rain/src/Parse/Yaml.php

Yaml helper class

Public methods

public array parse(string $contents)

Parses supplied YAML contents in to a PHP array.

Parameters
  • string $contents - YAML contents to parse.

public array parseFile(string $fileName)

Parses YAML file contents in to a PHP array.

Parameters
  • string $fileName - File to read contents and parse.

public void render(array $vars=array(), array $options=array())

Renders a PHP array to YAML format.

Parameters
  • array $vars
  • array $options - Supported options:
  • inline: The level where you switch to inline YAML.
  • exceptionOnInvalidType: if an exception must be thrown on invalid types.
  • objectSupport: if object support is enabled.