Actually i was a fan of YAML regarding the configuration files of Symfony2.
This was probably because i was used to it since symfony 1.4 and i also thought its better readable.
Its partly still true, but my Netbeans Editor has some problems with using @ in YAML and this breaks my highlighting.
So the better readability vanished to nirvana.
So i checked out XML configuration. Its also widely used by the community.
Pros and Cons (mostly Pros) you can read in this post by Fabien.
And yeah its true, these advantages from Fabiens Post i really appreciate:
- When a XML file is loaded, it is automatically validated with the built-in services.xsd file
- The XML can be auto-completed in IDEs;
- The XML format is faster than the YAML one;
So here are two tips how to convert certain constructs from YAML to XML.
I had to search for that so i like to mention it.
Arrays in Parameters
<br />parameters:<br /> my.array: [value1,value2]<br />
<br /><parameters><br /> <parameter key="my.array" type="collection"><br /> <parameter>value1</parameter><br /> <parameter>value2</parameter><br /> </parameter><br /></parameters><br />
Arrays are of type collection in XML. This structure also applys to Arguments.
<br />arguments: [@this.service.defined.before]<br />
<br /><argument type="service" id="this.service.defined.before" /><br />
Hope it helps :)