flash icon indicating copy to clipboard operation
flash copied to clipboard

Flashes in twig

Open purrplingcat opened this issue 8 years ago • 0 comments

Hi, I have a problem with flashes in twig. I want pop stack of flash and write messages to template. For pop stack i use shift() like written in doc. But it's not works. Twig not support while loop, only for with syntax for <i> in <source>. Useless for pop flash stack.

{% for alert in flash.shift() %}
    <div class="alert alert-{{alert.type}} alert-dismissible fade show general-alert" role="alert">
      {{alert.message}}
      <button type="button" class="close" data-dismiss="alert" aria-label="Close">
        <span aria-hidden="true">&times;</span>
      </button>
    </div>
{% endfor %}

How I solve this problem?

purrplingcat avatar Dec 12 '17 16:12 purrplingcat