PHPackages                             zealproject/zeal-messages - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. zealproject/zeal-messages

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zealproject/zeal-messages
=========================

Simple helper/controller plugin for showing app messages

61.2k1PHP

Since Dec 27Pushed 12y ago2 watchersCompare

[ Source](https://github.com/zealproject/zeal-messages)[ Packagist](https://packagist.org/packages/zealproject/zeal-messages)[ RSS](/packages/zealproject-zeal-messages/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Zeal Messages
=============

[](#zeal-messages)

This module provides an easy way of displaying messages to the user. It is designed as an alternative to ZF's flash messenger, and in additional to the flash messenger's functionality, includes the ability to set different types of message (e.g. 'info' messages, 'error' messages), and functionality to show messages to the user immediately (rather than on the next request as the flash messenger does).

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

[](#installation)

The best way to install the module is with Composer (). Add this to your `composer.json`:

```
"require": {
    "zealproject/zeal-messages": "dev-master"
}

```

then run `composer install` to install.

You'll also need to edit your `application.config.php` to add `ZealMessages` to your module array.

Usage
-----

[](#usage)

To add messages, from a controller action, to show a message to the user immediately:

```
$this->messages()->info('Your message here');
```

or an error message:

```
$this->messages()->error('Your error message here');
```

'success' messages are also supported.

To add flash messages (which are added to the session and shown to the user on the subsequent request), usage is:

```
$this->messages()->flashInfo('Your message here');
```

or:

```
$this->messages()->flashError('Your error message here');
```

and so on.

So a controller action that processes form data might look like:

```
public function editAction()
{
    [load data and setup $form]

    if ($this->getRequest()->isPost()) {
        $form->setData($this->getRequest()->getPost());
        if ($form->isValid()) {
            $data = $form->getData();

            if ([code to save $data]) {
                $this->messages()->flashInfo('Your details were successfully saved');
                $this->redirect()->toRoute([some route]);
            } else {
                $this->messages()->error('An error occurred saving your details');
            }
        }
    }

    return new ViewModel(array(
        'form' => $form
    ));
}
```

### Rendering messages

[](#rendering-messages)

The module includes a view helper for rendering messages. You would typically add this your layout, above the view content:

```

```

It will only output HTML if there are some messages to display.

The messages are output in an unordered list (one list per type) within a div with the id `messages` for easy CSS styling. Each list has the message type as the class name, for example:

```

        Your details were successfully saved

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e5d59064cc9ccc7cf03693549ae65934cc091780a2a9b8d89007797bee7dbb0d?d=identicon)[tfountain](/maintainers/tfountain)

---

Top Contributors

[![tfountain](https://avatars.githubusercontent.com/u/387569?v=4)](https://github.com/tfountain "tfountain (3 commits)")

### Embed Badge

![Health badge](/badges/zealproject-zeal-messages/health.svg)

```
[![Health](https://phpackages.com/badges/zealproject-zeal-messages/health.svg)](https://phpackages.com/packages/zealproject-zeal-messages)
```

###  Alternatives

[frittenkeez/laravel-vouchers

Voucher system for Laravel 9+

5819.9k2](/packages/frittenkeez-laravel-vouchers)[setasign/php-stub-generator

A tool to generate stub-files for your php classes.

302.1k1](/packages/setasign-php-stub-generator)

PHPackages © 2026

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