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

flash & flashSession message

In my application, flash messages can be output by {{ content() }}, but CANNNOT output by {{flash.output()}}

and flashSession messages can be output by {{flashSession.output()}}, but CANNOT output by {{content}}!

How to output them both by {{content()}}?

$this->flash->error("Problem does not exist " . $id);
            return $this->dispatcher->forward(
                array(
                    "action" => "list"
                )
            );
...

$this->flashSession->success("created!");
$this->response->redirect('problems/list');

In your index.volt (directly in your view dir) or in your layout-view, insert {{flashSession.output()}}

Then both of them will get show when you output {{content()}} in a view.

Why not just write both of them?

{{ flashSession.output() }}
{{ content() }}