Download the PHP package szmnmichalowski/szm-notification without Composer
On this page you can find all versions of the php package szmnmichalowski/szm-notification. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download szmnmichalowski/szm-notification
More information about szmnmichalowski/szm-notification
Files in szmnmichalowski/szm-notification
Package szm-notification
Short Description Controller plugin to store notifications in session. Used for notification view helper
License MIT
Homepage https://github.com/szmnmichalowski/SzmNotification
Informations about the package szm-notification
SzmNotification
SzmNotification is a Zend Framework 2/3 controller plugin which stores notification in session container (same as FlashMessanger). It is designed to work with one of the following notifiction helpers:
- SzmNoty - jQuery plugin http://ned.im/noty/
Installation
You can install this module via composer
1. Add this project into your composer.json
2. Update your dependencies
3. Add module to your application.config.php. It requires Zend\Session
Usage
This plugin has defined 4 types of notifications by default:
- info
- success
- warning
- error
But it is possible to add notification under custom type
How to use it
Examples of use:
Available methods:
Global methods:
add($type, $text)
- Add notificationhas($type)
- Check if namespace contains any notification added in previous requesthasCurrent($type)
- Check if namespace contains any notification added during this requestget($type)
- Return notifications from previous requestgetCurrent($type)
- Return notifications from current requestgetAll()
- Return all notifications from previous requestgetAllCurrent()
- Return all notifications from current request
Following methods are available for each type (including custom type). Just replace *
with notification type:
add*($text)
- Add notificationhas*()
- Check if namespace contains any notification added in previous requesthasCurrent*()
- Check if namespace contains any notification added during this requestget*()
- Return notifications from previous requestgetCurrent*()
- Return notifications from current request
Examples: