templates/includes/alerts.html.twig line 1

Open in your IDE?
  1. {% if app.request.hasPreviousSession %}
  2.     <div class="messages">
  3.         {% for type, messages in app.flashes %}
  4.             {% for message in messages %}
  5.                 {# Bootstrap alert, see https://getbootstrap.com/docs/3.4/components/#alerts #}
  6.                 <div class="alert alert-dismissible alert-{{ type }}" role="alert">
  7.                     <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  8.                         <span aria-hidden="true">&times;</span>
  9.                     </button>
  10.                     {{ message|trans }}
  11.                 </div>
  12.             {% endfor %}
  13.         {% endfor %}
  14.     </div>
  15. {% endif %}
  16. {% if formPurchase is defined and formPurchase.vars is defined %}
  17.     {% set formErrors = formPurchase.vars.errors.form.getErrors(true) %}
  18.     {% if formErrors|length %}
  19.         <div class="alert alert-dismissible alert-danger" role="alert">
  20.             <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  21.                 <span aria-hidden="true">&times;</span>
  22.             </button>
  23.             {% for error in formErrors %}
  24.                 {{ error.message }}
  25.             {% endfor %}
  26.         </div>
  27.     {% endif %}
  28. {% endif %}
  29. {% if error.messageKey is defined %}
  30.     <div class="alert alert-dismissible alert-danger" role="alert">
  31.         <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  32.             <span aria-hidden="true">&times;</span>
  33.         </button>
  34.         {{ error.messageKey|trans(error.messageData, 'security') }}
  35.     </div>
  36. {% endif %}