templates/flashes.html.twig line 1

Open in your IDE?
  1. {% for label, messages in app.flashes(['success', 'notice', 'warning', 'error']) %}
  2.     {% if label == "success" %}{% set color = "w3-green" %}{% endif %}
  3.     {% if label == "notice" %}{% set color = "w3-yellow" %}{% endif %}
  4.     {% if label == "warning" %}{% set color = "w3-orange" %}{% endif %}
  5.     {% if label == "error" %}{% set color = "w3-red" %}{% endif %}
  6.     {% if messages is not empty %}
  7.         <div class="w3-panel w3-round {{ color }}">
  8.             {% for message in messages %}
  9.                 <p>{{ message }}</p>
  10.             {% endfor %}
  11.         </div>
  12.     {% endif %}
  13. {% endfor %}