coolms/dtmpl
A sandboxed template language for non-PHP authors, with lexer, parser, AST and runtime, plus extensible widgets, filters and loaders. No PHP, filesystem or arbitrary calls—framework-optional, with a Symfony bundle available.
Two breaking changes. Both affect templates, not the PHP API.
{var:}, {const:} and {t:} encode what they emit, including the values
interpolated into a translation. 1.x encoded nothing.
Migration: add the raw filter to any value that is deliberately markup --
{var:page.body raw}. For a catalogue entry containing markup, {t:key raw}
emits the sentence as markup and encodes its parameters instead. A host can put
a CoolMS\Dtmpl\Runtime\RenderedHtml in the context to mark a value as markup
without every template remembering raw.
OutputMode::Text turns encoding off for a render that is not producing HTML --
a filename pattern, a spreadsheet cell, an OOXML run.
{raw} renamed to {verbatim}The verbatim block and the raw filter shared a word while doing unrelated
things. The block suppresses parsing of a region of source; the filter
suppresses encoding of a value. The block is renamed; the filter is unchanged.
Migration: {raw} to {verbatim}, {endraw} to {endverbatim}. Leave
every raw filter usage alone.
{raw} and {endraw} raise RemovedKeywordException naming the replacement,
so no template silently degrades to literal text. Template source stored outside
the repository -- document templates, spreadsheet templates, user-authored
content -- needs the same rename and fails at render time until it gets it.
==, !== and > = raise messages naming the real operator.{loop:} modifier is an error naming the nearest real one,
instead of being ignored.UnknownFilterException (under TemplateException)
rather than a bare SPL InvalidArgumentException.php. prefix is reserved: registering a filter under it is refused.{def:offset=-5}, {var:n add:-5}.{var:x default: ... } reaches the default filter; default= remains the
path fallback.First release. The DTMPL template engine: a designer-facing template language with a lexer, parser, AST and runtime, plus a widget seam for host-supplied components.
How can I help you explore Laravel packages today?