Session Flash消息未在CakePHP中显示?
我试图在我的ctp中显示flash消息。我已经申报了Session Flash消息未在CakePHP中显示?,session,cakephp,flash-message,Session,Cakephp,Flash Message,我试图在我的ctp中显示flash消息。我已经申报了 var $helpers = array('Html','Session','Form','Js'); 在app\u controller.php中,我编写代码 $this->Session->setFlash("Error!!!!!!!!!") 在我的控制器里。但是它没有显示在我的视图.ctp文件中 我有自己的模板。Flash消息没有显示在我自己的模板中。您声明了吗 var $helpers = array('Session
var $helpers = array('Html','Session','Form','Js');
在app\u controller.php
中,我编写代码
$this->Session->setFlash("Error!!!!!!!!!")
在我的控制器里。但是它没有显示在我的视图.ctp
文件中
我有自己的模板。Flash消息没有显示在我自己的模板中。您声明了吗
var $helpers = array('Session');
在你的控制器里
如果你已经声明了,你有没有试着回应
$this->Session->flash()
在您的视图中?我已经声明了var$helpers=array('Session'),并且我已经在我的视图中测试了$this->Session->flash(),但它没有显示flash消息。@shariphwar他/她试图说,
$this->Session->flash()
本身没有回声。您必须明确地将echo$this->Session->flash()
elitalon放在正确的位置。您必须明确地将echo$this->Session->flash()放在您的视图中^ _; ^很抱歉我的回答不清楚。您能再给我们看一点代码吗?了解上下文,而不仅仅是一行,通常是有帮助的。