templates/flashes.html.twig line 1

Open in your IDE?
  1. {% set type_map = {'error': 'danger', 'notice': 'info'} %}
  2. {% for key, messages in app.session.flashBag.all %}
  3.     {% set type = type_map[key] ?? key %}
  4.     {% if type in ['success', 'warning', 'danger', 'info'] %}
  5.         {% for msg in messages %}
  6.             <div class="alert alert-{{ type }} alert-dismissible fade show" role="alert">
  7.                 {{ msg|trans }}
  8.                 <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="{{ 'Close'|trans }}"></button>
  9.             </div>
  10.         {% endfor %}
  11.     {% endif %}
  12. {% endfor %}