kevinkaske / flash
A simple library to give you flash message support via the $_SESSION superglobal array
dev-master
2024-11-05 21:08 UTC
Requires
- php: >=5.3.0
This package is auto-updated.
Last update: 2024-12-05 21:25:21 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