We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

LEVEL_ACTION_VIEW flashSession or flash messages not work

Hello, When I use in my action the code below, the message is not displayed, can anyone help me solve?

$ this-> flashSession-> success ('Message sent successfully!');
$ this-> view-> setRenderLevel (View :: LEVEL_ACTION_VIEW);
$ this-> view-> render ('contact', 'send');

tks.



10.5k
Accepted
answer

maybe your forgot to put <?php $this->flashSession->output() ?> into your view

or

you put it in a view that is not covered before the VIEW_LEVEL that you set. (LEVEL after View :: LEVEL_ACTION_VIEW)

Thanks for your reply.

I checked my page, and I saw that I had forgotten to put the {{content()}} on the top of the page.

tks..