Reputation: 3592
I am trying to set a success element to my setFlash.
When I do:
$this->Session->setFlash("Message");
It shows the message perfectly, however, with a red background. After investigating I can change the element to "success" which should show a nice green background, but when I do:
$this->Session->setFlash("Message","success");
I get:
Element Not Found: Elements\success.ctp
I have verified and there is definately a success.ctp file within my app/View/Elements/ folder.
I am using cakePHP 2.1
** EDIT **
It may be a routing error as I also find that sometimes on redirect it will redirect example users/users/login as appose to users/login/
Upvotes: 0
Views: 1761
Reputation: 1
delete true in $this->Session->setFlash('Book is Updated!', true);
Upvotes: 0
Reputation: 26
src.
Upvotes: 1
Reputation: 3592
As per the suggestion by @Learner, the correct code which worked (for me in 2.1) is:
$this->Session->setFlash('Message.','default',array('class'=>'success'));
Upvotes: 0