How to change the default setFlash () in CakePHP ?
How or where change this default element:
<div id="flashMessage" class="message">
My message.
</div>
Necessary:
<div id="myid" class="myclass">
My message.
</div>
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
According to the documentation:
Create the file app/View/Elements/flash_custom.ctp and build our custom flash element:
Then call
setFlash()with those parameters:The output in your template from using
$this->Session->flash()with the above example would be then: