Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Flash getMessages remove

Hi, how can I remove flash messages from session after they have been shown?

In volt, i'm currently doing this

  {% for error in flash.getMessages('error', true) %}
    <li> {{ error }} </li>
  {%endfor%}

However it does not remove them, what should I use in order to do this?



6.0k

I'm going to assume you're using the getMessages for a reason here rather than the flash.output method. For sake of argument, have you tried using that method? does it show the same behavior?



2.8k
Accepted
answer
edited Nov '14

Well the reason is that I couldn't get them all displayed in one div, rather than apply a div for each of them, if that makes sense? In this way, I have more flexibility and I can display the error messages however I want, epecially when I have different kind of error messages.. Anyway, I got it working once I have changed the response to redirect instead of forward. Then I had some problems with flashing old inputs because again I didn't know how to do it:D but that's all sorted now so thanks anyway.



6.0k

Awesome, glad you got it fixed! :)

Any change you can mark your response as the solved answer?