2017 © Pedro Peláez
 

library flash

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

image

kevinkaske/flash

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

  • Tuesday, June 23, 2015
  • by kevinkaske
  • Repository
  • 1 Watchers
  • 1 Stars
  • 177 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 5 % Grown

The README.md

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)

The Versions

23/06 2015

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Kevin Kaske