PHPackages                             dieschittigs/contao-flash-bundle - 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. dieschittigs/contao-flash-bundle

ActiveContao-bundle

dieschittigs/contao-flash-bundle
================================

1.0.2(7y ago)133MITPHP

Since Mar 17Pushed 6y ago4 watchersCompare

[ Source](https://github.com/DieSchittigs/contao-flash-bundle)[ Packagist](https://packagist.org/packages/dieschittigs/contao-flash-bundle)[ RSS](/packages/dieschittigs-contao-flash-bundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

⚡ Contao Flash
==============

[](#-contao-flash)

This is a bundle for Contao 4.4+. It makes working with flash messages (short lived, informal messages for a single user) very convenient.

Features
--------

[](#features)

- 🔋 Ready to use frontend module, including style sheets and JavaScript
- ⏳ Messages stay in session until rendered (or dismissed)
- ⁉️ Display success, error, info and entirely custom messages
- 👽 Advanced features for name-spacing and further customization
- 📼 Simple and solid, works even in environments with disabled JS

Installation
------------

[](#installation)

Install via Contao Manager or Composer:

```
composer require dieschittigs/contao-flash-bundle

```

Basic Usage
-----------

[](#basic-usage)

Add a new frontend module "Flash Messages" to your page layout. This is where your messages will be displayed – at the top of the main container might be a good place.

If you want to display a message, say inside a hook method, do it like this:

```
// Info
Flash::info('The weather ☀️ is great today!');

// Success
Flash::success('Transaction complete.');

// Warning
Flash::warning('Wir brauchen mehr Silos!');

// Custom html message
Flash::comfirmnuke('Please confirm.Yes.Nope.');

```

ℹ️ *The `Flash` class resides in the `Contao` namespace, so (probably) no `use` statement needed.*

The messages will be saved in the users session. They *wait* until they are rendered in the frontend module, then they delete themselves. So you have longer running processes with multiple redirects and several messages? No problem 🕶️.

ℹ️ *Messages "stack", so if you have e.g. multiple warnings, they will all be displayed once the frontend module gets displayed*

The resulting HTML might look like this:

```

                    The email address you entered was malformed …

                    … but we were able to fix it. Everything's fine.

                window.ContaoFlash = window.ContaoFlash || {};
                window.ContaoFlash.clear = [id1, id2];

```

Advanced Usage
--------------

[](#advanced-usage)

### Creating an advanced flash message

[](#creating-an-advanced-flash-message)

```
Flash::warning('Your account has been compromised.')
->setAutoDismiss(false) // User has to dismiss this message manually
->addClass(['important', 'user']) // Additional CSS classes
->setNamespace('profile') // Only show this message in modules with the matching namespace

```

### Routes

[](#routes)

Want to display your messages via JS? Got ya covered!

#### \[GET\] `flash/get`

[](#get-flashget)

Gets you an JSON array with all messages.

```
// Response
[
    {
        id: 'MIW987K',
        type: 'info',
        cssClasses: ['info'],
        message: 'Item purchased',
        autoDismiss: true,
        namespace: 'checkout'
    },
    …
]

```

#### \[GET\] `flash/clear?id={id}`

[](#get-flashclearidid)

Purges the message with the provided id.

#### \[GET\] `flash/clear?ids={id1,id2}`

[](#get-flashclearidsid1id2)

Purges the message*s* with the provided id*s*.

### Customize

[](#customize)

Take a peek at `Resources/public` for CSS and JS.

MIT © [Die Schittigs](https://www.dieschittigs.de)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~3 days

Total

3

Last Release

2602d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2b7b269de0f43c92af67c5932ea04a2d610f3bf186f496af04f4117852037379?d=identicon)[benfolds](/maintainers/benfolds)

![](https://www.gravatar.com/avatar/675d504ab41a615f10b88b54fe000ea2d05158c6d4cd3425a6f863bd6ac22e8f?d=identicon)[Padarom](/maintainers/Padarom)

![](https://www.gravatar.com/avatar/283eb1ecd96736aad40cae1393e0c362b7dc92dc0a68827eed360af4f9909e19?d=identicon)[saibotd](/maintainers/saibotd)

---

Top Contributors

[![saibotd](https://avatars.githubusercontent.com/u/1080347?v=4)](https://github.com/saibotd "saibotd (7 commits)")

---

Tags

contaocontao-bundleflash-messages

### Embed Badge

![Health badge](/badges/dieschittigs-contao-flash-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/dieschittigs-contao-flash-bundle/health.svg)](https://phpackages.com/packages/dieschittigs-contao-flash-bundle)
```

PHPackages © 2026

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