2

I am trying to show a flash message in my ctp. I already declared

var $helpers = array('Html','Session','Form','Js');

at app_controller.php and I write the code

$this->Session->setFlash("Error!!!!!!!!!")

in my controller. But it doesn't show up in my view .ctp file.

I've a own template. Flash message doesn't show up in my own template.

elitalon
  • 9,191
  • 10
  • 50
  • 86
Sharifah
  • 361
  • 2
  • 17
  • 30
  • Can you show us a little bit more code? Knowing the context, not only a single line, is usually helpful. – elitalon Dec 01 '11 at 09:47

1 Answers1

1

Did you declare

var $helpers = array('Session');

in your controller?

If you you have declared it, did you try echoing

$this->Session->flash()

in your view?

elitalon
  • 9,191
  • 10
  • 50
  • 86
unknown
  • 385
  • 3
  • 6
  • 18
  • I already declared var $helpers= array('Session') and i already test $this->Session->flash() in my view but it doesn't show flash message. – Sharifah Dec 01 '11 at 09:26
  • @shariphwar He/She is trying to say that `$this->Session->flash()` does not echo by itself. You have to explicitly put `echo $this->Session->flash()` – elitalon Dec 01 '11 at 09:46
  • elitalon is right. you have tto explicitly put echo $this->Session->flash() in your view ^___^ sorry for not being clear on my answer.. – unknown Dec 01 '11 at 15:00