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

Little Problem with Flash Message

I have a problem to print a message flash when I sign out the sesión. So, this message is not display in my route /view/login/index and I’m using flash direct and flash sesión to know if display it, but neither is displayed.

Hi, You should use Flash Session Message in your controller same: (Doc https://docs.phalcon.io/en/latest/reference/flash.html)

public function LogoutAction()
   $this->flashSession->success('Logout Message');
   return $this->response->redirect('/admin/user/login/');

Register flashSession with Di

$di->set('flashSession', function () {
   $flashSession = new \Phalcon\Flash\Session(array(
        'warning' => 'alert alert-warning',
        'notice' => 'alert alert-info',
        'success' => 'alert alert-success',
        'error' => 'alert alert-danger',
    return $flashSession;
}, true);



I'm doing that, but doesn't work... !!!


Could you upload file index.volt ?



<!DOCTYPE html>
        {{ content() }}