Skip to content

flash messages

David Spreekmeester edited this page Dec 2, 2014 · 1 revision

Throwing Flash messages

To provide user feedback after a browser redirect, we use so-called Flash messages. This is simple textual feedback that will be displayed in an HTML element.

From within a controller:

<?php
$msg = 'Very good. You deserve a cookie.';
$this->_helper->flashMessenger($msg);
$this->_redirect('/');
?>

This will result in a redirect to the homepage, where the provided message will be displayed to the user.

Clone this wiki locally