We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

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>

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


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?

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.


Awesome, glad you got it fixed! :)

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