| METHODS | |
|---|---|
setSpecVersion()
| sets the YAML specification version to use. |
getSpecVersion()
| gets the YAML specification version to use. |
load()
| loads YAML into a PHP array. |
dump()
| dumps a PHP array to a YAML string. |
echoln()
| wraps echo to automatically provide a newline. |
Sets the YAML specification version to use.
| ARGUMENTS | |
|---|---|
$version |
The YAML specification version |
Gets the YAML specification version to use.
returns The YAML specification version
Loads YAML into a PHP array.
The load method, when supplied with a YAML stream (string or file),
will do its best to convert YAML in a file into a PHP array.
Usage:
$array = sfYaml::load('config.yml');
print_r($array);
| ARGUMENTS | |
|---|---|
$input |
Path of YAML file or string containing YAML |
returns The YAML converted to a PHP array
throws InvalidArgumentException If the YAML is not valid
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.
| ARGUMENTS | |
|---|---|
$array |
PHP array |
$inline |
The level where you switch to inline YAML |
returns A YAML string representing the original PHP array
Wraps echo to automatically provide a newline.
| ARGUMENTS | |
|---|---|
$string |
The string to echo with new line |
