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 http://docs.phalconphp.com/en/latest/reference/flash.html)

public function LogoutAction()
{
   $this->session->remove('auth');
   $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);

Thanks!



9.0k

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



473

Could you upload file index.volt ?



9.0k

view/index.volt

<!DOCTYPE html>
<html>
    <head>
        {{get_title()}}
    </head>
    <body>
        {{ content() }}
    </body>
</html>