YtsAnchorAlias.yml (859B)
1 --- %YAML:1.0 2 test: Simple Alias Example 3 brief: > 4 If you need to refer to the same item of data twice, 5 you can give that item an alias. The alias is a plain 6 string, starting with an ampersand. The item may then 7 be referred to by the alias throughout your document 8 by using an asterisk before the name of the alias. 9 This is called an anchor. 10 yaml: | 11 - &showell Steve 12 - Clark 13 - Brian 14 - Oren 15 - *showell 16 php: | 17 array('Steve', 'Clark', 'Brian', 'Oren', 'Steve') 18 19 --- 20 test: Alias of a Mapping 21 brief: > 22 An alias can be used on any item of data, including 23 sequences, mappings, and other complex data types. 24 yaml: | 25 - &hello 26 Meat: pork 27 Starch: potato 28 - banana 29 - *hello 30 php: | 31 array(array('Meat'=>'pork', 'Starch'=>'potato'), 'banana', array('Meat'=>'pork', 'Starch'=>'potato'))