Syntaxe pour utiliser nos variables en Twig
Commentaire
{# Mon commentaire twig #}Afficher une variable
{{ email }}Condition
{% if username != 'jean' %}
    
{% endif %}Multiple conditions
{% if (username != 'jean' and username != 'jeanne') or username == 'admin' %}
{% endif %}Boucle
{% for product in products %}
    {{ product.name }}
{% endfor %}Tester une variable
{{ dump(app) }}
{% dump(app) %}Récupérer la route actuelle
{{ app.request.get('_route') }}
18/11/2021