Print message on next page

1

How do I print a message when opening a page, for example:

I'm on page Cliente/View and when I'm redirected to Nfe/index page, I want to print a message with instructions on what to do, pulling some data from Cliente/View .

I tried to use

$this->Session->setFlash('mensagem');

But I continued with no results, only the message is displayed when I return to page Cliente/View again.

    
asked by anonymous 08.02.2017 / 13:42

1 answer

0

For this same case, the following answer helped me, see it below:

When using setFlash , you can provide a key value, for example:

$this->Session->setFlash('This message is for form 1.', 'default', array(), 'form1');

Then you can print the flash above each form. It will only be displayed if the specified key has a value.

<?php echo $this->Session->flash('form1') ?>

For more information, see Creating Notification Message .

    
08.02.2017 / 14:17