I want to use an <a> inside a flashMessenger message.
For example:
In my website I have some blog posts, and when I delete one of them, I want to show a message like:
"Success! <a>Undo</a>"
My code:
$restore = $this->url()->fromRoute('news/restore', array('id' => $id));
$this->flashMessenger()->addSuccessMessage("Success. <a href='$restore'>Undo</a>");
return $this->redirect()->toRoute('news');
But It doesn't work when I put that <a> inside the message.
How can I do that?
The way it worked for me:
By default the autoEscape property is set to
trueFactory? Maybe?
source:
https://github.com/zendframework/zend-view/blob/master/src/Helper/FlashMessenger.php