Whitespace.php 786 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Whitespace test for tag names.
  4. *
  5. * Per http://github.com/janl/mustache.js/issues/issue/34/#comment_244396
  6. * tags should strip leading and trailing whitespace in key names.
  7. *
  8. * `{{> tag }}` and `{{> tag}}` and `{{>tag}}` should all be equivalent.
  9. *
  10. * @extends Mustache
  11. */
  12. class Whitespace extends Mustache {
  13. public $foo = 'alpha';
  14. public $bar = 'beta';
  15. public function baz() {
  16. return 'gamma';
  17. }
  18. public function qux() {
  19. return array(
  20. array('key with space' => 'A'),
  21. array('key with space' => 'B'),
  22. array('key with space' => 'C'),
  23. array('key with space' => 'D'),
  24. array('key with space' => 'E'),
  25. array('key with space' => 'F'),
  26. array('key with space' => 'G'),
  27. );
  28. }
  29. protected $_partials = array(
  30. 'alphabet' => " * {{.}}\n",
  31. );
  32. }