https://github.com/thecodingmachine/html.widgets.messageservice
Use this package to display info/warning/error messages to the user on a web page. Using the SessionMessageService class, you register messages to be displayed. Using the MessageWidget class, you display the error messages in your templates.
https://github.com/thecodingmachine/html.widgets.messageservice
Last synced: about 1 year ago
JSON representation
Use this package to display info/warning/error messages to the user on a web page. Using the SessionMessageService class, you register messages to be displayed. Using the MessageWidget class, you display the error messages in your templates.
- Host: GitHub
- URL: https://github.com/thecodingmachine/html.widgets.messageservice
- Owner: thecodingmachine
- Created: 2012-11-27T17:47:31.000Z (over 13 years ago)
- Default Branch: 4.0
- Last Pushed: 2022-12-01T16:13:10.000Z (over 3 years ago)
- Last Synced: 2025-06-05T23:55:02.834Z (about 1 year ago)
- Language: PHP
- Size: 44.9 KB
- Stars: 0
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# User Message Service
This service allows to implement user oriented messaging. It relies on a simple function that will add a message with a given level, and an HTML block that will render user's messages when the page is loaded.

## Using the Service
When the package is installed, a block is added to the template's content. When rendered, this block will dump the messages that were stored into the session.
Add a message :
```php
$messageService->setMessage("User foo bar has been successfully cerated", UserMessageInterface::SUCCESS);
```
The `UserMessageInterface` defines 4 types of message :
* SUCCESS
* INFO
* WARNING
* ERROR
By default, the message will be displayed in the header block. But you are free to insert this block anywhere.
More Information can be found here :
* [Using the message service](doc/index.md)
* [Advanced usage](doc/advanced.md)