I have a Zend Framework application that is making use of jQuery UI.
In my controllers, I am setting error/success messages with the FlashMessenger helper like this:
// ExampleController.php
$this->_helper->FlashMessenger( Sorry, could not complete your request. );
In my layout, I am displaying the messages by using the Noumenal FlashMessenger View Helper
// layout.phtml
<?php echo $this->flashMessenger(); ?>
I want to make use of my jQuery UI theme s CSS styles to style my error messages like this:
<div class="ui-state-error ui-corner-all">
<p><span class="ui-icon ui-icon-alert"></span>
<strong>Alert:</strong> Sample ui-state-error style.</p>
</div>
...but the View Helper is doing all the work, so I can t change the classes how I want to. So before going down a dead end route, I thought I d ask the community. Here are my questions:
- How can I use the Zend Framework FlashMessenger so that I can set different messages depending on the state (error/success)?
- How can I get the messages from the FlashMessenger and display them in a single place without having to create duplicate code in all of my controllers?
- How can I output a different class for each of the different message states? For example:
error => ui-state-error , info => ui-state-highlight
, etc.