falgunphp / notification
v0.0.3
2021-06-24 18:03 UTC
Requires
- php: ^7.4|^8.0
- falgunphp/http: ^0.0
Requires (Dev)
- phpunit/phpunit: ^9.5
- sempro/phpunit-pretty-print: ^1.4
- vimeo/psalm: ^3.18
This package is auto-updated.
Last update: 2024-09-25 01:18:47 UTC
README
简单的通知管理库。
安装
请注意,需要 PHP 7.4 或更高版本。
通过 Composer
$ composer require falgunphp/notification
用法
<?php use Falgun\Http\Session; use Falgun\Notification\Notification; $notification = new Notification(new Session()); $notification->successNote('Oh Yeah'); $notification->warningNote('Oh ho'); $notification->errorNote('hold up'); // all 3 notification has been saved to $_SESSION $notes = $notification->flashNotifications(); // to get notifications and remove them from session // or $notes = $notification->getNotifications(); // only get notifications and don't remove them foreach($notes as $note){ echo $note->getMessage(); // this is the message of the note echo $note->getType(); // success or warning or error }
许可证
MIT 许可证 (MIT)。请参阅 许可证文件 获取更多信息。