You are here

public static function Yaml::parseFile in Lockr 7.3

Parses a YAML file into a PHP value.

Usage:

$array = Yaml::parseFile('config.yml'); print_r($array);

Parameters

string $filename The path to the YAML file to be parsed:

int $flags A bit field of PARSE_* constants to customize the YAML parser behavior:

Return value

mixed The YAML converted to a PHP value

Throws

ParseException If the file could not be read or the YAML is not valid

File

vendor/symfony/yaml/Yaml.php, line 57

Class

Yaml
Yaml offers convenience methods to load and dump YAML.

Namespace

Symfony\Component\Yaml

Code

public static function parseFile($filename, $flags = 0) {
  $yaml = new Parser();
  return $yaml
    ->parseFile($filename, $flags);
}