If you look at the source code, you will see that the second parameter to the SessionComponent method is the name of the element:
function setFlash($message, $element = 'default', $params = array(), $key = 'flash')
You can create a file in the views / Elements (or Views / Elements for Cake2) called for the example 'flash_notification.ctp'
with the following contents:
<p class="notification">
<?php echo $message; ?>
</p>
and use
$this->Session->setFlash(__('My message.'), 'flash_notification');
source
share