https://github.com/iftekhersunny/flash
Flash helps you to add flash messages to your PHP application.
https://github.com/iftekhersunny/flash
Last synced: 5 months ago
JSON representation
Flash helps you to add flash messages to your PHP application.
- Host: GitHub
- URL: https://github.com/iftekhersunny/flash
- Owner: IftekherSunny
- License: mit
- Created: 2015-07-13T14:09:36.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-09-10T08:08:58.000Z (over 9 years ago)
- Last Synced: 2024-12-08T23:49:03.241Z (6 months ago)
- Language: PHP
- Homepage: https://packagist.org/packages/sun/flash
- Size: 1.33 MB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Flash
[](https://travis-ci.org/IftekherSunny/Flash) [](https://packagist.org/packages/sun/flash) [](https://packagist.org/packages/sun/flash) [](https://packagist.org/packages/sun/flash) [](https://packagist.org/packages/sun/flash)
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.
```php
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.
```php
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.
```php
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
```html
```Add this line at the bottom of your page
```html
$(function () {
$('.flash-modal').modal();
})
```## All Methods
###### To show success message
```php
$flash = new Sun\Flash;
$flash->success('Hello');
```###### To show error message
```php
$flash->error('Whoops! There were some problems with your input.');
```###### To show info message
```php
$flash->info('your message');
```###### To show warning message
```php
$flash->warning('your message');
```###### To show confirm message
```php
$flash->confirm('Message Title', 'Your Message');
```###### To show bootstrap modal popup message
```php
$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](https://github.com/IftekherSunny/flash/blob/master/LICENSE)