Yaml
Definition from the YAML official website (http://www.yaml.org/): Yaml is an intuitive data serialization format that can be read by a computer, easily accessible by humans, and easily interacting with scripting languages. To put it another way, Yaml is a very simple XML-like Data description language, and syntax is much simpler than XML. He is very useful in describing data that can be converted into clusters or hashes, such as:
$house = Array (
' Family ' => Array (
' Name ' => ' Doe ',
' Parents ' => array (' John ', ' Jane '),
' Children ' => Array (' Paul ', ' Mark ', ' Simone ')
),
' Address ' => array (
' Number ' => 34,
' Street ' => ' Main Street ',
' City ' => ' Nowheretown ',
' ZipCode ' => ' 12345 '
)
);
Parsing this yaml will automatically create the following PHP array:
House
Family
Name:doe
Parents
-John
-Jane
Children
-Paul
-Mark
-Simone
Address
Number:34
Street:main Street
City:nowheretown
zipcode:12345
Inside the YAML, the structure is expressed by indenting, successive items are represented by a minus sign "-", and the key/value in the map structure is delimited by a colon ":". Yaml is also useful to describe the abbreviated syntax for several lines of identical structure data, which are included with ' [] ', and the hash is included with ' {} '. So, this yaml in front can be abbreviated like this:
House
Family: {name:doe, parents: [John, Jane], children: [Paul, Mark, Simone]}
Address: {number:34, Street:main Street, City:nowheretown, zipcode:12345}
YAML is the abbreviation for "yet Another Markup Language (another Markup language)", pronunciation "Yamel", or "Jamel". This format is about 2001, and so far there are yaml parsers in many languages.
Hint YAML format of the specific specifications can be found in the YAML official website http://www.yaml.org/.
As you can see, writing Yaml is much faster than XML (no need to turn off tags or quotes) and is more powerful than '. ini ' file (INI file does not support hierarchy). So Symfony chooses YAML as the preferred format for configuration information. You'll see a lot of yaml files in this book, but it's intuitive that you don't need to delve into YAML.