Skip to content
Justin Hileman edited this page Aug 15, 2015 · 7 revisions

Mustache pragmas are non-standard extensions to the Mustache spec. They look like {{% THIS }}. Many useful Mustache features were first implemented as pragmas in individual libraries before being added to the spec. This was the case for Dot Notation and implicit iterators.

Mustache.php currently implements the following pragmas:

Warning

Because pragmas are not yet part of the Mustache spec, they come with a few caveats. They might change or be removed in future releases. They are not supported by some (or all) other flavors of Mustache, so your templates will not be as portable. When they are supported in other libraries, they might be implemented differently.