1
In the method in my controller I select the flash, according to the condition.
if ($this->Auth->user()) {
//redireciona apos o login;
echo $this->Session->setFlash("Bem-vindo");
}
How can I display this directly from the view instead of in the method? For example, the method would return true
in case of logged in and on the page to which I directed the user I would access the flash message or something like.
I don’t want to use echo
, since it is a short and temporary message or until the page is reloaded or updated.
I tried to access the $this->Session->setFlash()
, but gives helper error. Maybe, me creating a helper would solve the problem then? The $this->Session->flash()
no message. I would only access a component, in case it could be the Auth
, for example: $this->Session->flash('Auth');
Someone suggests something?