templates/site/utils/flagsBag.html.twig line 1

Open in your IDE?
  1. {% set alert = {'success': 'success', 'error': 'error', 'info': 'info', 'warning': 'warning'} %}
  2. {% for flashType in alert %}
  3.     {% for flashMessage in app.session.flashbag.get(flashType) %}
  4.         <script>
  5.             toastr.options = {
  6.                 "closeButton": true,
  7.                 "debug": false,
  8.                 "newestOnTop": true,
  9.                 "progressBar": false,
  10.                 "positionClass": "toast-top-right",
  11.                 "preventDuplicates": false,
  12.                 "onclick": null,
  13.                 "showDuration": "400",
  14.                 "hideDuration": "800",
  15.                 "timeOut": "5000",
  16.                 "extendedTimeOut": "1000",
  17.                 "showEasing": "swing",
  18.                 "hideEasing": "linear",
  19.                 "showMethod": "slideDown",
  20.                 "hideMethod": "slideUp"
  21.             };
  22.             toastr["{{ alert[flashType] }}"]("{{ flashMessage | raw }}");
  23.         </script>
  24.     {% endfor %}
  25. {% endfor %}