sun/flash
最新稳定版本:v1.5
Composer 安装命令:
composer require sun/flash
包简介
Flash helps you to add flash messages to your PHP application.
README 文档
README
Flash helps you to add flash messages to your PHP application.
Installation Process
Just copy Flash folder somewhere into your project directory. Then include flash autoloader.
require_once('/path/to/Flash/autoload.php');
Flash is also available via Composer/Packagist.
composer require sun/flash
Flash Message View Installation Process
If you install flash manually, just add this line where you want to show flash message.
include('/path/to/Flash/view/flash.php');
If you install flash via composer, You need to publish flash message view. To publish flash message view -
php vendor/sun/flash/publish
Then, include this view where you want to show flash message.
include('view/Flash_Message.php);
In Flash message view I used Bootstrap css framework for flash message styling. You also need to add bootstrap to your project.
Bootstrap css, js and jQuery cdn
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <script src="http://code.jquery.com/jquery-2.1.4.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
Add this line at the bottom of your page
<script> $(function () { $('.flash-modal').modal(); }) </script>
All Methods
To show success message
$flash = new Sun\Flash; $flash->success('Hello');
To show error message
$flash->error('Whoops! There were some problems with your input.');
To show info message
$flash->info('your message');
To show warning message
$flash->warning('your message');
To show confirm message
$flash->confirm('Message Title', 'Your Message');
To show bootstrap modal popup message
$flash->overlay( 'Message Title', 'Your Message', true, 'Allow Button Text', 'Allow Button Type', 'Dismiss Button Text', 'Dismiss Button Type );
Defalut value for --
Submit Button = false
Allow Button Text = Save
Allow Button Type = success
Dismiss Button Text = Close
Dismiss Button Type = default
Screenshots
Flash Message Overlay:
Flash Message Success:
Flash Message Error:
License
This package is licensed under the MIT License
统计信息
- 总下载量: 53
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-07-13


