2017 © Pedro Peláez
 

library php-flash-message

Flash messenger that will keep messages until they are "flushed" - current or persistant states.

image

martynbiz/php-flash-message

Flash messenger that will keep messages until they are "flushed" - current or persistant states.

  • Thursday, January 21, 2016
  • by martynbiz
  • Repository
  • 1 Watchers
  • 0 Stars
  • 160 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 3 % Grown

The README.md

Flash

Flash messenger that will keep messages until they are \"flushed\" - current or persistant states., (*1)

Installation

Composer, (*2)

"require-dev": {
    "martynbiz/php-flash-message": "dev-master"
}

Usage

Add message, (*3)

$flash = new \MartynBiz\FlashMessage\Flash;
$flash->addMessage('success', 'You have successfully registered');

Check if message exists by key, (*4)

$flash->has('success'); // true
$flash->has('errors'); // false

Flush messages, (*5)

This method can be called during the same HTTP request or future request. This means it is useful when redirecting but also forwarding to, for example, another controller action. The contents of the container will be emptied when this method is called once., (*6)

$messages = $flash->flushMessages();

Using custom storage

It is possible to use your own storage object, as long as it implements ArrayAccess interface. Below Zend\Storage\Container has been used:, (*7)

$container = new Zend\Session\Container('mycontainer');
$flash = new Flash($container);

TODO, (*8)

  • create a simple session storage as default

The Versions

21/01 2016

dev-master

9999999-dev http://github.com/martynbiz/php-flash

Flash messenger that will keep messages until they are "flushed" - current or persistant states.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

message flash

21/01 2016

1.0.0

1.0.0.0 http://github.com/martynbiz/php-flash

Flash messenger that will keep messages until they are "flushed" - current or persistant states.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

message flash