2017 © Pedro Peláez
 

library slim-flash

Slim Framework Flash message service provider [fork of slim/flash]

image

krotovic/slim-flash

Slim Framework Flash message service provider [fork of slim/flash]

  • Wednesday, May 31, 2017
  • by krotovic
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 30 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % 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 krotovic/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); }); $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

31/05 2017

dev-master

9999999-dev http://slimframework.com

Slim Framework Flash message service provider [fork of slim/flash]

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

framework slim message provider flash

31/05 2017

dev-#24-message-in-array

dev-#24-message-in-array http://slimframework.com

Slim Framework Flash message service provider [fork of slim/flash]

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

framework slim message provider flash

31/05 2017

0.2.1

0.2.1.0 http://slimframework.com

Slim Framework Flash message service provider [fork of slim/flash]

  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