In a CakePHP 1.2 app, I’m using
<?php $session->flash();?>
to output messages like ‘Record edited’. It’s working great.
However, I want to add a link called ‘Dismiss’ that will fade out the message. I know how to construct the link, but I don’t know how to insert into the output of the flass message.
The flash message wraps itself in a DIV tag. I want to insert my dismiss code into that div, but I don’t know how.
Figured this out: Create a new layout in your layouts folder:
In that layout, include the call to output the content:
Then when you set the flash message, specify the layout to use: