Twig yields an escaped string and treats a missing variable as empty
The rule
Normative: this is the rule
- A Twig template always produces a string, HTML-escaped unless the value is piped through
raw. - A variable absent from the context renders as the empty string rather than failing.
- A template that cannot be compiled, and a template that fails while rendering, both fail with an error saying which of the two occurred.
Rule identifiers are permanent and are never renumbered. Each implementation publishes its own standing against these rules; this specification does not.spec 1.0-draft · LANG-7 · changed in spec 1.0