Strict variables are off for every template file: an undefined variable renders as nothing. The one strict context is email subjects and bodies rendered from templates, which raise on a missing variable and fall back to plain placeholder substitution. Guard with |default('') or is defined, and remember that on a response model is defined is true for every name, so it guards nothing there; test the value instead.
Answer
Errors and blank pages
A Twig template errors on an undefined variable that used to render empty
More in Errors and blank pages
Was this page helpful?
Your answer goes to the docs team.