Twig Guide
Twig Basics
{{ variable }}
{{ user.username }}
{{ product.name }}{{ text|upper }}
{{ date|date('Y-m-d') }}
{{ price|number_format(2, '.', ',') }}
{{ content|raw }} {# Render HTML #}{{ asset('assets/theme/my-theme/css/style.css') }}
{{ path('route_name') }}
{{ url('route_name', {id: 123}) }}{% if condition %}
...
{% elseif other_condition %}
...
{% else %}
...
{% endif %}
{% for item in items %}
{{ item.name }}
{% else %}
No items found
{% endfor %}Blocks and Inheritance
Including Templates
Macros (Reusable Functions)
Common PteroCA Variables
Asset Function
Translation Function
Useful Twig Filters
Filter
Description
Example
Useful Twig Tests
Best Practices
Common Patterns
Debugging
Related Guides
External Resources
Last updated