{% macro avatar(image, alt, class) %} {% if image %} {{ alt }} {% else %} {{ alt }} {% endif %} {% endmacro %} {# the following code is based on phiamo/MopaBootstrapBundle https://github.com/phiamo/MopaBootstrapBundle/blob/88b104b3efd4c3c3bfff1df4525a53bc3596010b/Resources/views/flash.html.twig #} {% macro flash(type, message, close, use_raw, class, domain) %}
{% if close|default(false) %} {% endif %} {% if use_raw|default(false) %} {{ message|trans({}, domain|default('AdminLTEBundle'))|raw }} {% else %} {{ message|trans({}, domain|default('AdminLTEBundle')) }} {% endif %}
{% endmacro %} {% macro session_flash(close, use_raw, class, domain) %} {% import _self as flash_messages %} {% if app.session.flashbag.peekAll|length > 0 %} {% for type, messages in app.session.flashbag.all %} {% for message in messages %} {% if type == 'fos_user_success' %} {% set type = 'success' %} {% set domain = 'FOSUserBundle' %} {% endif %} {{ flash_messages.flash(type, message, close, use_raw, class, domain) }} {% endfor %} {% endfor %} {% endif %} {% endmacro %}