Show message on public part : renderMessage > Documentation
This plugin allow a plugin dev to quickly show a message anywhere on surveys. Showing a complete message and end the page or just display a flash message.
render a message in your plugin
To show a message to a public user and quit after, simply use this part of code:
- $message="Message to be shown to your user";
- $renderMessage = new \renderMessage\messageHelper();
- $renderMessage->render($message);
There are only one parameters : string to be shown, no filter is set: the you can use HTML in your message.
The plugin find the language and the template to use directly testing the survey, the language of user and the default template used.
render a flash message in your plugin
To show a flash message to a public user like an alert, simply use this part of code:
- $message="Message to be shown to your user";
- $renderMessage = \renderMessage\flashMessageHelper::getInstance();
- $renderFlashMessage->addFlashMessage($message,'warning');
The plugin use 2 parameters : the HTML message and the extra class for the box : available are success, info, warning and danger.
Each flash message have class rm-flash-message
and the alert alert-type
for default bootsrap class inside a wrapper with class rm-flash-container
The css are
- .rm-flash-container{
- position:fixed;
- top:2em;
- right:2em;
- width:20em;
- z-index:100000;/* default template 2000 : wher we go after ? */
- }