flextype-components / notification
用于存储和检索闪存数据的通知组件。
v1.0.2
2019-02-05 19:16 UTC
Requires
- php: ^7.1.3
This package is auto-updated.
Last update: 2024-09-06 10:45:56 UTC
README
用于存储和检索闪存数据的通知组件。
安装
composer require flextype-components/notification
使用
use Flextype\Component\Notification\Notification;
初始化通知服务。
这将从 $_SESSION
变量中读取通知/闪存数据并将其加载到 $this->previous 数组中。
Notification::init();
从通知数组中返回特定变量。
echo Notification::get('success'); echo Notification::get('errors');
将特定变量添加到通知数组中。
Notification::set('success', 'Data has been saved with success!'); Notification::set('errors', 'Data not saved!');
将特定变量添加到当前页面的通知数组中。
Notification::setNow('success', 'Success!');
清除通知数组。
之前页面存储的数据不会删除,只是删除当前页面存储的数据。
Notification::clean();