I integrate “Twitter Bootstrap” with my little CakePHP project, I have 2 questions:
1) There is a way to use the standards flash messages? (because after the integration the alerts are not working anymore)
2)How can I use this Js alert? (in vers 2.7 the flash messages were changed from
<?php $this->Session->setFlash("Flash Message");?>
to
<?php $this->Flash->success(__('Flash Message'));?>
and I can’t find the way to do that)
Thanks.
2
Answers
FlashComponent
provides far more flexibility than whatSession->setFlash()
does.Now you are not bound to a single method, but can implement as many different flash ‘magic’ methods as you wish.
To be able to flash a custom flash message with
You need to create an element in
with the appropriate HTML/javascript template.
You have more information in the Cookbook 2.x: Setting Flash Messages
// please include any jquery min js Create a file called success.ctp in app/View/Elements/ folder