2017 © Pedro Peláez
 

library flash

Slim Framework Flash message service provider

image

lefuturiste/flash

Slim Framework Flash message service provider

  • Saturday, December 23, 2017
  • by lefuturiste
  • Repository
  • 0 Watchers
  • 0 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 30 Forks
  • 0 Open issues
  • 5 Versions
  • 18 % Grown

The README.md

Slim Framework Flash Messages

Build Status, (*1)

This repository contains a Slim Framework Flash messages service provider. This enables you to define transient messages that persist only from the current request to the next request., (*2)

Install

Via Composer, (*3)

``` bash $ composer require slim/flash, (*4)


Requires Slim 3.0.0 or newer. ## Usage ```php // Start PHP session session_start(); $app = new \Slim\App(); // Fetch DI Container $container = $app->getContainer(); // Register provider $container['flash'] = function () { return new \Slim\Flash\Messages(); }; $app->get('/foo', function ($req, $res, $args) { // Set flash message for next request $this->flash->addMessage('Test', 'This is a message'); // Redirect return $res->withStatus(302)->withHeader('Location', '/bar'); }); $app->get('/bar', function ($req, $res, $args) { // Get flash messages from previous request $messages = $this->flash->getMessages(); print_r($messages); // Get the first message from a specific key $test = $this->flash->getFirstMessage('Test'); print_r($test); }); $app->run();

Please note that a message could be a string, object or array. Please check what your storage can handle., (*5)

Using with Twig-View

If you use Twig-View, then slim-twig-flash may be a useful integration package., (*6)

Testing

bash $ phpunit, (*7)

Contributing

Please see CONTRIBUTING for details., (*8)

Security

If you discover any security related issues, please email security@slimframework.com instead of using the issue tracker., (*9)

Credits

License

The MIT License (MIT). Please see License File for more information., (*10)

The Versions

23/12 2017

dev-master

9999999-dev http://slimframework.com

Slim Framework Flash message service provider

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

framework slim message provider flash

23/12 2017

0.5.0

0.5.0.0 http://slimframework.com

Slim Framework Flash message service provider

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

framework slim message provider flash

22/10 2017

0.4.0

0.4.0.0 http://slimframework.com

Slim Framework Flash message service provider

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

framework slim message provider flash

11/11 2016

0.2.0

0.2.0.0 http://slimframework.com

Slim Framework Flash message service provider

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

framework slim message provider flash

17/08 2015

0.1.0

0.1.0.0 http://slimframework.com

Slim Framework Flash message service provider

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

framework slim message provider flash