Skip to content

A simple library to give you flash message support via the $_SESSION superglobal array

License

Notifications You must be signed in to change notification settings

kevinkaske/flash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Flash

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

About

A simple library to give you flash message support via the $_SESSION superglobal array

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages