yamlDecode() public static method

Parses YAML into a PHP array.
public static yamlDecode ( string $value ) : array
$value string YAML string
return array
Beispiel #1
0
 /**
  * Returns the content of a config file.
  *
  * @param string $file    Path to the file
  * @param mixed  $default Default value
  *
  * @return mixed Content of the file or default value if the file isn't readable
  */
 public static function getConfig($file, $default = [])
 {
     $content = self::get($file);
     return $content === null ? $default : rex_string::yamlDecode($content);
 }