Test your Twig knowledge with a free interactive quiz — 20 questions with answers and explanations. No signup needed to play.
Question 1/12Score 0
How does Twig handle conditional logic (if/else) within a template?
In this round
How does Twig handle conditional logic (if/else) within a template?
How does Twig typically handle template caching, and why does this matter for application performance?
What is the purpose of the `{% verbatim %}` tag in Twig?
What is the `default` filter used for in Twig, e.g. `{{ user.nickname|default('Anonymous') }}`?
What is the purpose of Twig's `{% set %}` tag?
How does Twig handle accessing a property or calling a method on a PHP object passed into a template, given the dot syntax like `{{ user.name }}`?
How do you deliberately output raw, unescaped HTML in a Twig template when auto-escaping would otherwise interfere (e.g. rendering trusted, pre-sanitized HTML content)?
What is a common security-related reason Twig restricts the template syntax to a limited set of constructs, rather than allowing arbitrary raw PHP code directly within templates?
What is Twig?
What is Twig's "sandbox" mode used for?
What is the purpose of automatic output escaping in Twig, and why is it enabled by default?
What is a Twig "filter", and how is it applied to a value?