packagist mustache/mustache v2.7.0
Mustache.php v2.7.0

latest releases: dev-main, v2.14.2, dev-dynamic-names...
9 years ago
  • Add template inheritance, via the BLOCKS pragma. Thanks @jazzdan and the rest of the @etsy devs!
  • Add a pragmas option to the Mustache_Engine constructor for enabling default pragmas.
  • A couple of performance improvements. Thanks @nizsheanez!
  • Code cleanup. Thanks @keradus!
  • Check coding standards on CI. Thanks @keradus!
  • Fix whitespace bug in nested partials. Thanks for the bug report, @mikesherov and @behance!
  • Allow omitting the filters on closing section tags, for example, {{# a | b }}{{/ a }} is now valid.
  • Increase test coverage, improve comments and examples.

If you process Mustache parse trees yourself…

Note that the parse tree representation of filtered interpolation and section tokens has changed. The tag name is now separate from the filters list. For example, the template:

{{%FILTERS}}
{{ foo | bar }}

was parsed as:

[
  [
    "type" => "%",
    "name" => "FILTERS",
    "line" => 0
  ],
  [
    "type"  => "_v",
    "name"  => "foo | bar | baz",
    "otag"  => "{{",
    "ctag"  => "}}",
    "line"  => 0,
    "index" => 33
  ]
]

but is now parsed as:

[
  [
    "type" => "%",
    "name" => "FILTERS",
    "line" => 0
  ],
  [
    "type"    => "_v",
    "name"    => "foo",
    "otag"    => "{{",
    "ctag"    => "}}",
    "line"    => 0,
    "index"   => 33,
    "filters" => [
      "bar",
      "baz"
    ]
  ]
]

Don't miss a new mustache release

NewReleases is sending notifications on new releases.