PHPackages                             kriss/yii2-alert-notify - 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. kriss/yii2-alert-notify

ActiveYii2-extension

kriss/yii2-alert-notify
=======================

Yii2 Alert Notify

v1.1(6y ago)0381MITPHP

Since Nov 8Pushed 6y ago1 watchersCompare

[ Source](https://github.com/krissss/yii2-alert-notify)[ Packagist](https://packagist.org/packages/kriss/yii2-alert-notify)[ RSS](/packages/kriss-yii2-alert-notify/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Yii2 Alert Notify
=================

[](#yii2-alert-notify)

Yii2 Alert Notify

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

[](#installation)

```
composer require kriss/yii2-alert-notify -vvv

```

Usage Ajax Notify
-----------------

[](#usage-ajax-notify)

1. Create a controller like: `AjaxController`, then add action:

```
public function actions()
{
    $actions = parent::actions();

    $actions['notify'] = [
        'class' => AjaxNotifyAction::class,
        'generateInfo' => 'generateNotifyInfo',
    ];

    return $actions;
}
```

2. Write `generateNotifyInfo` in controller, this is example:

```
public function generateNotifyInfo($from)
{
    $info = [];
    // get info from db or other storage
    // example
    if (random_int(0, 999) > 300) {
        $info[] = [
            'notifyOptions' => [
                'message' => date('H:i:s') . '：Has New Message',
                'url' => Url::to(['site/index']),
                'target' => '_self',
            ],
            'notifySettings' => [
                'delay' => 0,
                'type' => 'info',
                'offset' => [
                    'x' => 20,
                    'y' => 70,
                ],
            ],
            'audioConfig' => [
                'url' => Yii::getAlias('@web/audio/sound1.mp3'),
                'count' => 1,
                'delay' => 1000,
            ],
        ];
    }
    // example End
    return $info;
}
```

3. Use Widget in View, like `layouts/main.php`

```

```

4. After refresh browser, you will see:

[![preview1](https://github.com/krissss/yii2-alert-notify/raw/master/preview/preview1.jpg)](https://github.com/krissss/yii2-alert-notify/raw/master/preview/preview1.jpg)

Ajax Notify `generateInfo` Result Description
---------------------------------------------

[](#ajax-notify-generateinfo-result-description)

- notifyOptions: see [bootstrap-notify Options](http://bootstrap-growl.remabledesigns.com/)
- notifySettings: see [bootstrap-notify Settings](http://bootstrap-growl.remabledesigns.com/)
- audioConfig:

    - url: audio src
    - count: audio play count
    - delay: how long between audio play ended and play next, unit `ms`

Usage Flush Notify
------------------

[](#usage-flush-notify)

1. Use Widget in View, like `layouts/main.php`

```

```

2. Add flush message in controller or service:

```
Yii::$app->session->addFlash('success', 'Operate Success');
Yii::$app->session->addFlash('danger', 'Operate danger');
Yii::$app->session->addFlash('error', 'Operate error');
```

3. After refresh browser, you will see:

[![preview1](https://github.com/krissss/yii2-alert-notify/raw/master/preview/preview2.jpg)](https://github.com/krissss/yii2-alert-notify/raw/master/preview/preview2.jpg)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2378d ago

### Community

Maintainers

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

---

Top Contributors

[![krissss](https://avatars.githubusercontent.com/u/10680903?v=4)](https://github.com/krissss "krissss (2 commits)")

---

Tags

yii2extensionnotifyalert

### Embed Badge

![Health badge](/badges/kriss-yii2-alert-notify/health.svg)

```
[![Health](https://phpackages.com/badges/kriss-yii2-alert-notify/health.svg)](https://phpackages.com/packages/kriss-yii2-alert-notify)
```

PHPackages © 2026

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