Reputation: 637
I need to send more than 1 session flash with cakephp, I have found some solutions how to create a for loop and put together a deal but wanted to know if there was any native function of cake for something.
Upvotes: 0
Views: 65
Reputation: 21743
Two days ago I wrote http://www.dereuromark.de/2014/04/21/cakephp-flash-messages-2-0/
Which basically added support for this in CakePHP1.x, and therefore also for CakePHP2.x now. It stacks multiple messages per type, as well. Details see the Wiki.
Upvotes: 1
Reputation: 4526
Its really not clear what you really wants- but to create multiple flash message as on documentation-
// set a bad message.
$this->Session->setFlash('Something bad.', 'default', array(), 'bad');
// set a good message.
$this->Session->setFlash('Something good.', 'default', array(), 'good');
And on your view-
echo $this->Session->flash('good');
echo $this->Session->flash('bad');
And there is a Helper you can checkout- MultiFlashHelper
Upvotes: 0