YtsAnchorAlias.yml

drupal/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsAnchorAlias.yml

File

drupal/core/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/YtsAnchorAlias.yml
View source
  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. test: Alias of a Mapping
  20. brief: >
  21. An alias can be used on any item of data, including
  22. sequences, mappings, and other complex data types.
  23. yaml: |
  24. - &hello
  25. Meat: pork
  26. Starch: potato
  27. - banana
  28. - *hello
  29. php: |
  30. array(array('Meat'=>'pork', 'Starch'=>'potato'), 'banana', array('Meat'=>'pork', 'Starch'=>'potato'))