Flash
Flash is a Rails-like flash library written in PHP., (*1)
Installation (Composer)
Simply add the following to composer.json, (*2)
{
"require": {
"kevinkaske/flash": "dev-master"
}
}
Then run composer install. Composer will install the dependant libraries., (*3)
Uasge
After some action is done call code similar to the following:, (*4)
<? 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., (*5)
On the next page (usually this goes in a layout page) use some code like the following:, (*6)
<? if(isFlashMessage()){ ?>
<div class="alert-message success">
<p><?= getFlash('notice'); ?></p>
</div>
<? } ?>
You can (of course) change this anyway you see fit, (*7)