Smart.Framework Logo

final class \SmartYamlConverter
{ } ->

Class: SmartYamlConverter - provides a YAML Converter (Parser and Composer).
It will parse YAML to a PHP array, and also will compose YAML from a PHP array.


class Methods

public function __construct ( $log_errors = true, $dump_force_quotes = false ) {} @ 
public function getError ( ) {} -> STRING
@return: {STRING} the Error Message if Any
public function parse ( string $input ) {} -> ARRAY
@return: {array}
@param: {string} $input
Create a PHP array from YAML string
public function compose ( array $array, int $indent = 2 ) {} -> STRING
@return: {string} YAML
@param: {array} $array: PHP array
@param: {int} $indent: Pass in false to use the default, which is 2
Create YAML from PHP array
The dump method, when supplied with an array, will do its best
to convert the array into friendly YAML. Pretty simple. Feel free to
save the returned string as tasteful.yaml and pass it around.
Oh, and you can decide how big the indent is and what the wordwrap
for folding is. Pretty cool -- just pass in 'false' for either if
you want to use the default.
Indent's default is 2 spaces, wordwrap's default is 40 characters. And
you can turn off wordwrap by passing in 0.

class Properties


class Constants



documentation generated on: 2023-10-19 23:15:45 +0000


Smart.Framework © 2009-2023 unix-world.org