{% set type_map = {success: 'success', error: 'error', danger: 'error', warning: 'warning', info: 'info', notice: 'info'} %}
{% for flash_type, messages in app.flashes %} {% for message in messages %} {% include '@App/partials/layout/_toast.html.twig' with { toast: { id: 'toast_' ~ flash_type ~ '_' ~ loop.index ~ '_' ~ random(999999), type: type_map[flash_type]|default('info'), title: flash_type|capitalize, message: message, delay: 5000 } } only %} {% endfor %} {% endfor %} {% if login_error_toast|default(null) %} {% include '@App/partials/layout/_toast.html.twig' with {toast: login_error_toast} only %} {% endif %}