By writing the Noumenal FlashMessenger View Helper Helper , I have to help. :-)
To answer your question:
Adding Messages
You can set different message levels, for example. error , warning , etc., passing the array to the FlashMessenger action helper, rather than a simple line:
// ExampleController.php $this->_helper->FlashMessenger( array('error'=>'Sorry, could not complete your request.') );
The view helper is designed to recognize this.
Message output
When FlashMessages is displayed, your layout has additional parameters that you can pass to indicate the default message level (which is warning by default) and the template for your message.
Adapting a code fragment to account for different levels of messages, you can achieve the desired result by making the following call in your layout:
// layout.phtml $template = '<div class="ui-state-error ui-corner-all"> <p class="%s"><span class="ui-icon ui-icon-alert"></span> <span class="flash-message">%s</span></p> </div>'; echo $this->flashMessenger('error', $template);
(Perhaps you should set the template as a variable of the form, for example, in your boot file.)
By doing this, the view assistant will create the appropriate formatted flash messages for you as you wish.
Simple style
With CSS, there will be enough space for writing messages correctly. For example:
.alert { color: red; } .alert .flash-message:before { content: "<strong>Alert</strong> "; } .notice { color:yellow; } .notice .flash-message:before { content: "<strong>Notice</strong> "; }
I leave you to improvise ...
I wrote a guide for Zend Framework FlashMessenger and a view helper on my blog . Perhaps read this. Also, please write to me to inform me of your difficulties - this will help me find out what I need to improve.
I hope this helps.