sfMergeKey.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. --- %YAML:1.0
  2. test: Simple In Place Substitution
  3. brief: >
  4. If you want to reuse an entire alias, only overwriting what is different
  5. you can use a << in place substitution. This is not part of the official
  6. YAML spec, but a widely implemented extension. See the following URL for
  7. details: http://yaml.org/type/merge.html
  8. yaml: |
  9. foo: &foo
  10. a: Steve
  11. b: Clark
  12. c: Brian
  13. bar:
  14. a: before
  15. d: other
  16. <<: *foo
  17. b: new
  18. x: Oren
  19. c:
  20. foo: bar
  21. bar: foo
  22. foo2: &foo2
  23. a: Ballmer
  24. ding: &dong [ fi, fei, fo, fam]
  25. check:
  26. <<:
  27. - *foo
  28. - *dong
  29. isit: tested
  30. head:
  31. <<: [ *foo , *dong , *foo2 ]
  32. taz: &taz
  33. a: Steve
  34. w:
  35. p: 1234
  36. nested:
  37. <<: *taz
  38. d: Doug
  39. w: &nestedref
  40. p: 12345
  41. z:
  42. <<: *nestedref
  43. php: |
  44. array(
  45. 'foo' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian'),
  46. 'bar' => array('a' => 'before', 'd' => 'other', 'b' => 'new', 'c' => array('foo' => 'bar', 'bar' => 'foo'), 'x' => 'Oren'),
  47. 'foo2' => array('a' => 'Ballmer'),
  48. 'ding' => array('fi', 'fei', 'fo', 'fam'),
  49. 'check' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian', 'fi', 'fei', 'fo', 'fam', 'isit' => 'tested'),
  50. 'head' => array('a' => 'Steve', 'b' => 'Clark', 'c' => 'Brian', 'fi', 'fei', 'fo', 'fam'),
  51. 'taz' => array('a' => 'Steve', 'w' => array('p' => 1234)),
  52. 'nested' => array('a' => 'Steve', 'w' => array('p' => 12345), 'd' => 'Doug', 'z' => array('p' => 12345))
  53. )