 <p><strong>Update :</strong> </p> <p>Zend Framework new release added FlashMessenger View Helper , found in path <code>/library/Zend/View/Helper/FlashMessenger.php</code></p> <p><a href="https://github.com/zendframework/zf2/blob/master/library/Zend/View/Helper/FlashMessenger.php">FlashMessenger.php</a></p> <hr> <p><strong>Old answer :</strong></p> <p>I have written a custom view helper, for printing flash messages </p> <p>In /module/Application/Module.php</p> <pre><code>public function getViewHelperConfig() { return array( 'factories' =&gt; array( 'flashMessage' =&gt; function($sm) { $flashmessenger = $sm-&gt;getServiceLocator() -&gt;get('ControllerPluginManager') -&gt;get('flashmessenger'); $message = new \My\View\Helper\FlashMessages( ) ; $message-&gt;setFlashMessenger( $flashmessenger ); return $message ; } ), ); } </code></pre> <p>Create a custom view helper in /library/My/View/Helper/FlashMessages.php</p> <pre><code>namespace My\View\Helper; use Zend\View\Helper\AbstractHelper; class FlashMessages extends AbstractHelper { protected $flashMessenger; public function setFlashMessenger( $flashMessenger ) { $this-&gt;flashMessenger = $flashMessenger ; } public function __invoke( ) { $namespaces = array( 'error' ,'success', 'info','warning' ); // messages as string $messageString = ''; foreach ( $namespaces as $ns ) { $this-&gt;flashMessenger-&gt;setNamespace( $ns ); $messages = array_merge( $this-&gt;flashMessenger-&gt;getMessages(), $this-&gt;flashMessenger-&gt;getCurrentMessages() ); if ( ! $messages ) continue; $messageString .= "&lt;div class='$ns'&gt;" . implode( '&lt;br /&gt;', $messages ) .'&lt;/div&gt;'; } return $messageString ; } } </code></pre> <p>then simple call from layout.phtml , or your view.phtml</p> <pre><code>echo $this-&gt;flashMessage(); </code></pre> <p>Let me show example of controller action </p> <pre><code>public function testFlashAction() { //set flash message $this-&gt;flashMessenger()-&gt;setNamespace('warning') -&gt;addMessage('Mail sending failed!'); //set flash message $this-&gt;flashMessenger()-&gt;setNamespace('success') -&gt;addMessage('Data added successfully'); // redirect to home page return $this-&gt;redirect()-&gt;toUrl('/'); } </code></pre> <p>In home page, it prints</p> <pre><code>&lt;div class="success"&gt;Data added successfully&lt;/div&gt; &lt;div class="warning"&gt;Mail sending failed!&lt;/div&gt; </code></pre> <p>Hope this will helps !</p>