templates/default/_flash_messages.html.twig line 1

Open in your IDE?
  1. {#
       This is a template fragment designed to be included in other templates
       See https://symfony.com/doc/current/templates.html#including-templates
    
       A common practice to better distinguish between templates and fragments is to
       prefix fragments with an underscore. That's why this template is called
       '_flash_messages.html.twig' instead of 'flash_messages.html.twig'
    #}
    
    {#
       The check is needed to prevent starting the session when looking for "flash messages":
       https://symfony.com/doc/current/session.html#avoid-starting-sessions-for-anonymous-users
    
       TIP: With FOSHttpCache you can also adapt this to make it cache safe:
       https://foshttpcachebundle.readthedocs.io/en/latest/features/helpers/flash-message.html
    #}
    
    {% if app.request.hasPreviousSession %}
        {% for type, messages in app.flashes %}
            {% for message in messages %}
                <!--begin::Alert-->
                <div class="alert alert-{{ type }}">
        
                    <!--begin::Wrapper-->
                    <div class="d-flex flex-column">
                        <!--begin::Title-->
                        <h4 class="mb-1 text-dark">Mensaje</h4>
                        <!--end::Title-->
                        <!--begin::Content-->
                        <span>{{ message|trans }}</span>
                        <!--end::Content-->
                    </div>
                    <!--end::Wrapper-->
    
                </div>
            {% endfor %}
        {% endfor %}
    <!--end::Alert-->
    {% endif %}