2017-12-20 30 views
-1
내가 구성 요소
public $components = array('Paginator', 'Session', 'Flash'); 

다음 컨트롤러 플래시 메시지를 설정하려고 선언 한

cakephp2 플래시 구성 요소를 사용하는 것을 시도하고있다

작동하지 :

$this->Flash->error('The cashpickup could not be saved. Please, try again.'); // To display error 
$this->Flash->success(__('The user has been saved.')); // to display success 

을 그리고 보기에서 다음 코드를 사용하고 있습니다.

<?php echo $this->Flash->render(); ?> 

누구? 응용 프로그램에서

+2

을 참조로 "작동하지 않는"무엇 그게 무슨 뜻이야? 여기에 좀 더 많은 정보를 제공해야합니다. – mark

+0

@mark보기에 플래시 메시지가 표시되지 않습니다. –

답변

0

.. 나에게 그것이 작동하지 않는 이유 정확한 문제를 말할 수 /보기/요소/플래시/success.ctp

<div id="flash-<?php echo h($key) ?>" class="message-info success"> 
    <?php echo h($message) ?>: <?php echo h($params['name']) ?>, <?php echo h($params['email']) ?>. 
</div> 

https://book.cakephp.org/2.0/en/core-libraries/components/flash.html