# How to customize Flash message in Cakephp 2.x?

**URL:** https://discourse.cakephp.org/t/how-to-customize-flash-message-in-cakephp-2-x/835
**Category:** Need Help
**Created:** [July 28, 2016, 10:15am UTC](https://discourse.cakephp.org/t/how-to-customize-flash-message-in-cakephp-2-x/835 "2016-07-28T10:15:57Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Ashi123](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@Ashi123](https://discourse.cakephp.org/u/Ashi123)
#### Post date: [July 28, 2016, 10:15am UTC](https://discourse.cakephp.org/t/how-to-customize-flash-message-in-cakephp-2-x/835/1 "2016-07-28T10:15:57Z")

</div>

Hi friends , i have been working as a php developer and learning CakePHP, web Development. I am here to enhance my learning on Cakephp & want to customize flash message with alert flash box in our CakePHP web application. I hope any tech developer can help me over here in resolving the issue.

---

<div class="post-metadata">

### Author: ![Denis](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@Denis](https://discourse.cakephp.org/u/Denis)
#### Post date: [October 20, 2017, 11:56am UTC](https://discourse.cakephp.org/t/how-to-customize-flash-message-in-cakephp-2-x/835/2 "2017-10-20T11:56:04Z")

</div>

with setFlash:

$this-\>Session-\>setFlash(\_\_(‘my message’), ‘flash\_error’);

and place the flash\_error.ctp element in app/View/Elements folder

if you want info message

$this-\>Session-\>setFlash(\_\_(‘my message’), ‘flash\_info’);

and place the flash\_info.ctp element in app/View/Elements folder
