Symfony Howto: Write YAML Dynamically
Purpose
Sometimes it is necessary, and useful to update configuration scripts from within the Symfony application. While, it is simple to do, it may not be obvious to newcomers.
Code
$yaml = sfYaml::dump($your_array);
file_put_contents('path/file.yml', $yaml);
Usage