irfa / php-flash-message
"PHP 的 Flash 消息插件"
v1.0
2020-02-20 13:15 UTC
Requires
- php: >=5.4.0
This package is auto-updated.
Last update: 2024-09-27 17:43:51 UTC
README
配置文件 Irfa/Flashmsg/config.php
基本用法
<?php require_once 'Autoloader.php'; use Irfa\Flashmsg\Flash; ...
设置 Flash 消息
您可以在配置文件中自由设置消息类型、更改 CSS 类或消息视图。
Flash::set(key , message, type);
... ///SET FLASH Fail Flash::set('fail-msg' , 'Description is required','fail'); ///SET FLASH Success Flash::set('success-msg' , 'Update Success','success'); ///SET FLASH Info Flash::set('info-msg' , 'Please wait 1 minutes','success'); ///SET FLASH Warning Flash::set('warning-msg' , 'Username or Password Invalid','warning'); ///SET FLASH general Flash::set('general-msg' , 'Hello, i'm Message','general'); ///SET FLASH Other Flash::set('other-msg' , 'Just Other Message','other'); ...
获取 Flash 消息
Flash::get(key);
... ///GET FLASH MESSAGE Flash::get('msg'); ...