whagency / yii2-html5-notifications
Yii2 html5 web notifications
Installs: 91
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=5.4
This package is auto-updated.
Last update: 2025-03-07 20:41:38 UTC
README
Yii2 extension for converting yii2 flash message to html5 web notifications
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require "whagency/yii2-html5-notifications" "*"
or add to your composer.json file
"require": { "whagency/yii2-html5-notifications": "*" },
Usage Example
- Add widget to your page before
</body>
tag
... <?= \webheads\notifications\Alert::widget(['options' => [ 'logo' => 'https://github.com/whagency/yii2-html5-notifications/blob/master/demo/icon.png', 'hideAfter' => 5000, ]]) ?> </body> </html>
- Set yii2 flash message
Yii::$app->session->setFlash('success', 'My notification message');
- Allow html5 messages in your browser
- Result