Adds support for YAML to FluentDOM. It adds a loader and a serializer. It uses the Symfony/YAML component.
composer require fluentdom/yaml-symfony
The loader registers automatically. You can trigger it with the types yaml
and text/yaml
.
$document = FluentDOM::load($yaml, 'text/yaml');
$query = FluentDOM($yaml, 'text/yaml');
The serializer needs to be created for a document and can be cast into a string.
echo new FluentDOM\YAML\Symfony\Serializer($document);
$query = FluentDOM($yaml, 'text/yaml');
echo $query;