YML data manipulation

YML can easily be transformed to other formats using PHP.

  YML
  
test: Hello World
    

YML to Array

By using PluginWfYml one could load an YML file and output to an array.

  YML to Array
  
wfPlugin::includeonce('wf/yml');
$data = new PluginWfYml('/theme/wf/buto/example/example.yml');
$my_array = $data->get();

  Array
  
array('test' => 'Hello World');

YML to JSON

YML to JSON with json_encode().

  YML to JSON
  
wfPlugin::includeonce('wf/yml');
$data = new PluginWfYml('/theme/wf/buto/example/example.yml');
$my_json = json_encode($data->get());


  JSON
  
{"test":"Hello World"}

YML to serialized data

YML to serializon data with serialize().

  YML to Serialize data.
  
wfPlugin::includeonce('wf/yml');
$data = new PluginWfYml('/theme/wf/buto/example/example.yml');
$my_serialized = serialize($data->get());


  Serialize
  
a:1:{s:4:"test";s:11:"Hello World";}