Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Flash message not showing up

Hello,

When i use this code :

$this->flash->error('Incorrect login'); return $this->dispatcher->forward(array( 'controller' => 'session', 'action' => 'index' ));

When i get redirected to session/index i don't see the flash message. But if i remove the forward, the flash message shows up on the session/login page (where the code above is).

Why is that ?? I don't understand the issue. I've tried adding :

$this->flash->output() in the initialize of BaseController



2.0k

Ok i used flashSession and added $this->flashSession->output() in initialize of ControllerBase, also changed my forward to redirect for it to work.

Thanks!