1
根據JobsController的jsonresponse()函數中的一個條件,我想註銷用戶並將它們發送到登錄頁面,並顯示一條flash消息無效的用戶。CakePHP 2.6 flash消息沒有顯示
jsonresponse($數據)
if($data['status'] == '0'){
$this->Session->setFlash(__(INVALID_USERS_CREDENTIALS),'default', array('class' => 'error-flash-msg'));
return $this->redirect($this->Auth->logout());
}
現在它被重定向到登錄頁面,但閃光燈消息沒有顯示。
在Loginlayout
<div style="padding-left:12%">
<?php echo $this->Session->flash(); ?>
</div>
<div class="loginbox">
<?php echo $this->fetch('content');?>
</div>
</body>
什麼是這裏的問題,當我轉到登錄頁面,輸入無效的憑證,它給我提示信息。但是,在上述情況下,問題是什麼......! 任何幫助,非常感謝。謝謝。
您能不能告訴我們'調試($ _ SESSION)'在'view'結果' –
它什麼也沒有顯示..! – Aamir
但在重定向之前,如果我在控制器中調試($ _ SESSION),它將在控制器中顯示消息數據 – Aamir