PHPackages                             krotovic/slim-flash - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. krotovic/slim-flash

ActiveLibrary[Framework](/categories/framework)

krotovic/slim-flash
===================

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

0.2.1(8y ago)029MITPHPPHP &gt;=5.5.0

Since Aug 16Pushed 8y ago1 watchersCompare

[ Source](https://github.com/krotovic/Slim-Flash)[ Packagist](https://packagist.org/packages/krotovic/slim-flash)[ Docs](http://slimframework.com)[ RSS](/packages/krotovic-slim-flash/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (5)Used By (0)

Slim Framework Flash Messages
=============================

[](#slim-framework-flash-messages)

[![Build Status](https://camo.githubusercontent.com/f10b11be7483fdd1b10670e043db1176f3c5a5ad1c2825254c759f9cd00c16ba/68747470733a2f2f7472617669732d63692e6f72672f6b726f746f7669632f536c696d2d466c6173682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/krotovic/Slim-Flash)

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.

Install
-------

[](#install)

Via Composer

```
$ composer require krotovic/slim-flash
```

Requires Slim 3.0.0 or newer.

Usage
-----

[](#usage)

```
// 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.

### Using with Twig-View

[](#using-with-twig-view)

If you use [Twig-View](https://github.com/slimphp/Twig-View), then [slim-twig-flash](https://github.com/kanellov/slim-twig-flash) may be a useful integration package.

Testing
-------

[](#testing)

```
$ phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Josh Lockhart](https://github.com/codeguy)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 39% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor3

3 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~326 days

Total

3

Last Release

3218d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/892140a66741183b7e595c360fa0e47af94cff0c60d56ab865967e180b738b0b?d=identicon)[krotovic](/maintainers/krotovic)

---

Top Contributors

[![geggleto](https://avatars.githubusercontent.com/u/4027602?v=4)](https://github.com/geggleto "geggleto (11 commits)")[![silentworks](https://avatars.githubusercontent.com/u/79497?v=4)](https://github.com/silentworks "silentworks (10 commits)")[![akrabat](https://avatars.githubusercontent.com/u/33135?v=4)](https://github.com/akrabat "akrabat (8 commits)")[![codeguy](https://avatars.githubusercontent.com/u/31677?v=4)](https://github.com/codeguy "codeguy (4 commits)")[![krotovic](https://avatars.githubusercontent.com/u/5140307?v=4)](https://github.com/krotovic "krotovic (3 commits)")[![designermonkey](https://avatars.githubusercontent.com/u/221344?v=4)](https://github.com/designermonkey "designermonkey (3 commits)")[![timwattenberg](https://avatars.githubusercontent.com/u/120251?v=4)](https://github.com/timwattenberg "timwattenberg (2 commits)")[![JoeBengalen](https://avatars.githubusercontent.com/u/11173689?v=4)](https://github.com/JoeBengalen "JoeBengalen (1 commits)")[![rickycheers](https://avatars.githubusercontent.com/u/480247?v=4)](https://github.com/rickycheers "rickycheers (1 commits)")[![bcremer](https://avatars.githubusercontent.com/u/55820?v=4)](https://github.com/bcremer "bcremer (1 commits)")[![tflight](https://avatars.githubusercontent.com/u/4959691?v=4)](https://github.com/tflight "tflight (1 commits)")[![thinksalot](https://avatars.githubusercontent.com/u/568707?v=4)](https://github.com/thinksalot "thinksalot (1 commits)")

---

Tags

messageframeworkslimproviderflash

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/krotovic-slim-flash/health.svg)

```
[![Health](https://phpackages.com/badges/krotovic-slim-flash/health.svg)](https://phpackages.com/packages/krotovic-slim-flash)
```

###  Alternatives

[slim/flash

Slim Framework Flash message service provider

1662.2M89](/packages/slim-flash)[kanellov/slim-twig-flash

A Twig extension to access Slim Flash messages in templates

25106.9k8](/packages/kanellov-slim-twig-flash)[slim/twig-view

Slim Framework 4 view helper built on top of the Twig 3 templating component

3707.8M192](/packages/slim-twig-view)[gotzmann/comet

Modern PHP framework for building blazing fast REST APIs and microservices

68616.1k1](/packages/gotzmann-comet)[rubellum/slim-blade-view

Slim Framework 3 view helper built on the Blade component

1822.3k2](/packages/rubellum-slim-blade-view)[podcastcrawler/podcastcrawler

PHP library to find podcasts

402.7k](/packages/podcastcrawler-podcastcrawler)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
