{% import "@SyliusShop/Common/Macro/icons.html.twig" as icons %} {% if app.session is not null and app.session.started %} {% for type in ['success', 'error', 'info', 'warning'] %} {% for flash in app.session.flashbag.get(type) %} {% if 'error' == type %} {% set result = 'danger' %} {% set icon = icons.danger() %} {% endif %} {% if 'info' == type %} {% set result = 'info' %} {% set icon = icons.info() %} {% endif %}
{{ icon|default(icons.success()) }}
{% set header = 'sylius.ui.' ~ type %} {{ header|trans }}

{{ flash is iterable ? flash.message|trans(flash.parameters, 'flashes') : flash|trans({}, 'flashes') }}

{% endfor %} {% endfor %} {% endif %}