kevinkaske / flash
A simple library to give you flash message support via the $_SESSION superglobal array
Installs: 243
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/kevinkaske/flash
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2025-10-05 23:32:48 UTC
README
Flash is a Rails-like flash library written in PHP.
##Installation (Composer) Simply add the following to composer.json
{ "require": { "kevinkaske/flash": "dev-master" } }
Then run composer install
. Composer will install the dependant libraries.
##Uasge After some action is done call code similar to the following:
<? flash('notice', 'User has been added.'); ?>
This code is setting a flash message to be called on the next page and putting it in the "notice" category.
On the next page (usually this goes in a layout page) use some code like the following:
<? if(isFlashMessage()){ ?> <div class="alert-message success"> <p><?= getFlash('notice'); ?></p> </div> <? } ?>
You can (of course) change this anyway you see fit