Package Data | |
---|---|
Maintainer Username: | IftekherSunny |
Maintainer Contact: | iftekhersunny@hotmail.com (Iftekher Sunny) |
Package Create Date: | 2015-07-13 |
Package Last Update: | 2015-09-10 |
Home Page: | https://packagist.org/packages/sun/flash |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-26 15:03:46 |
Package Statistics | |
---|---|
Total Downloads: | 52 |
Monthly Downloads: | 2 |
Daily Downloads: | 0 |
Total Stars: | 3 |
Total Watchers: | 3 |
Total Forks: | 1 |
Total Open Issues: | 1 |
Flash helps you to add flash messages to your PHP application.
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
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.
<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>
$flash = new Sun\Flash;
$flash->success('Hello');
$flash->error('Whoops! There were some problems with your input.');
$flash->info('your message');
$flash->warning('your message');
$flash->confirm('Message Title', 'Your 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
This package is licensed under the MIT License