PHPackages                             nikserg/yii2-toastr - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. nikserg/yii2-toastr

ActiveYii2-extension[Mail &amp; Notifications](/categories/mail)

nikserg/yii2-toastr
===================

Simple javascript toast notifications

2.0.5(6y ago)0545BSD-3-ClausePHP

Since Apr 13Pushed 6y agoCompare

[ Source](https://github.com/nikserg/yii2-toastr)[ Packagist](https://packagist.org/packages/nikserg/yii2-toastr)[ Docs](https://github.com/lavrentiev/yii2-toastr)[ RSS](/packages/nikserg-yii2-toastr/feed)WikiDiscussions master Synced 2d ago

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

Yii2 - Javascript Toast Notifications
=====================================

[](#yii2---javascript-toast-notifications)

Simple javascript toast notifications - Javascript library for non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended.

[![Latest Stable Version](https://camo.githubusercontent.com/5c8f5710376160c0c1d42dfba6f8d18239874d462846285048cc499129c934e0/68747470733a2f2f706f7365722e707567782e6f72672f6c617672656e746965762f796969322d746f617374722f762f737461626c65)](https://packagist.org/packages/lavrentiev/yii2-toastr) [![Total Downloads](https://camo.githubusercontent.com/54bcf15538ca011866e6f5f5956626680ba3e91e8e93687213d9cff30a550650/68747470733a2f2f706f7365722e707567782e6f72672f6c617672656e746965762f796969322d746f617374722f646f776e6c6f616473)](https://packagist.org/packages/lavrentiev/yii2-toastr) [![Latest Unstable Version](https://camo.githubusercontent.com/9422b6f1090f51ec1e531213d087c750948b72d9177a9e228dfe2733441d7879/68747470733a2f2f706f7365722e707567782e6f72672f6c617672656e746965762f796969322d746f617374722f762f756e737461626c65)](https://packagist.org/packages/lavrentiev/yii2-toastr) [![License](https://camo.githubusercontent.com/e8f023c398e2bd752eaea31a4b586d24fcdd1a131e350f2044376649a3fa3d59/68747470733a2f2f706f7365722e707567782e6f72672f6c617672656e746965762f796969322d746f617374722f6c6963656e7365)](https://packagist.org/packages/lavrentiev/yii2-toastr)

Установка
---------

[](#установка)

Расширение устанавливается с помощью Composer интсрукция по установке [Composer](http://getcomposer.org/doc/00-intro.md#installation-nix)

Установка расширения через Composer, выполнить следующую команду:

```
composer require --prefer-dist lavrentiev/yii2-toastr

```

или (master)

```
composer require --prefer-dist lavrentiev/yii2-toastr "dev-master"

```

или внести изменения в секцию `require` в `composer.json` и выполнить `composer update`

```
"lavrentiev/yii2-toastr": "^2.0"

```

или (master)

```
"lavrentiev/yii2-toastr": "dev-master"

```

### Уведомления Notification::widget()

[](#уведомления-notificationwidget)

[![alt text](https://raw.githubusercontent.com/lavrentiev/yii2-toastr/master/screenshot/screenshot-1-2.png "Уведомления Notification::widget()")](https://raw.githubusercontent.com/lavrentiev/yii2-toastr/master/screenshot/screenshot-1-2.png)

```
use lavrentiev\widgets\toastr\Notification;

Notification::widget([
    'type' => 'info',
    'title' => 'Toast Notifications',
    'message' => 'Simple javascript toast notifications'
]);

Notification::widget([
    'type' => 'error',
    'title' => 'Toast Notifications',
    'message' => 'Simple javascript toast notifications'
]);

Notification::widget([
    'type' => 'success',
    'title' => 'Toast Notifications',
    'message' => 'Simple javascript toast notifications'
]);

Notification::widget([
    'type' => 'warning',
    'title' => 'Toast Notifications',
    'message' => 'Simple javascript toast notifications'
]);

Notification::widget([
    'type' => 'info',
    'message' => 'Simple javascript toast notifications'
]);

Notification::widget([
    'type' => 'error',
    'message' => 'Simple javascript toast notifications'
]);

Notification::widget([
    'type' => 'success',
    'message' => 'Simple javascript toast notifications'
]);

Notification::widget([
    'type' => 'warning',
    'message' => 'Simple javascript toast notifications'
]);
```

Также присутствует возможность настройки произвольного уведомления, по параметрам предусмотренным разработчиками [Toastr by CodeSeven](https://github.com/CodeSeven/toastr)

[![alt text](https://raw.githubusercontent.com/lavrentiev/yii2-toastr/master/screenshot/screenshot-3.png "Уведомления Notification::widget()")](https://raw.githubusercontent.com/lavrentiev/yii2-toastr/master/screenshot/screenshot-3.png)

```
Notification::widget([
    'type' => Notification::TYPE_ERROR,
    'title' => 'Toast Notifications',
    'message' => 'Simple javascript toast notifications',
    'options' => [
        "closeButton" => false,
        "debug" => false,
        "newestOnTop" => false,
        "progressBar" => false,
        "positionClass" => Notification::POSITION_TOP_RIGHT,
        "preventDuplicates" => false,
        "onclick" => null,
        "showDuration" => "300",
        "hideDuration" => "1000",
        "timeOut" => "5000",
        "extendedTimeOut" => "1000",
        "showEasing" => "swing",
        "hideEasing" => "linear",
        "showMethod" => "fadeIn",
        "hideMethod" => "fadeOut"
    ]
]);
```

### Уведомления NotificationFlash::widget()

[](#уведомления-notificationflashwidget)

Подключение осуществляеться глобально допустим в layouts проекта.

```

```

Также присутствует возможность настройки уведомлений, по параметрам предусмотренным разработчиками [Toastr by CodeSeven](https://github.com/CodeSeven/toastr)

```

```

[![alt text](https://raw.githubusercontent.com/lavrentiev/yii2-toastr/master/screenshot/screenshot-4.png "Уведомления NotificationFlash::widget()")](https://raw.githubusercontent.com/lavrentiev/yii2-toastr/master/screenshot/screenshot-4.png)

```
\Yii::$app->session->setFlash('error', 'This is the message');
\Yii::$app->session->setFlash('success', 'This is the message');
\Yii::$app->session->setFlash('info', 'This is the message');
\Yii::$app->session->setFlash('warning', 'This is the message');
```

[![alt text](https://raw.githubusercontent.com/lavrentiev/yii2-toastr/master/screenshot/screenshot-5.png "Уведомления NotificationFlash::widget()")](https://raw.githubusercontent.com/lavrentiev/yii2-toastr/master/screenshot/screenshot-5.png)

```
\Yii::$app->session->setFlash('warning', ['Error 1', 'Error 2', 'Error 3']);
\Yii::$app->session->setFlash('success', ['Error 1', 'Error 2', 'Error 3']);
```

Допустимые параметры
--------------------

[](#допустимые-параметры)

ПараметрЗначение по умолчаниюДопустимые значенияОписаниеtype`info``info`, `error`, `success`, `warning`Тип уведомленияtitle------Заголовок уведомленияmessage`Simple javascript toast notifications`---Текст уведомленияoptions`[]`[Подробней...](https://github.com/CodeSeven/toastr)Дополнительные опции**Допустимые константы типов:**

```
TYPE_INFO = 'info'
TYPE_ERROR = 'error'
TYPE_SUCCESS = 'success'
TYPE_WARNING = 'warning'

```

**Допустимые константы положения:**

```
POSITION_TOP_RIGHT = 'toast-top-right';
POSITION_TOP_LEFT = 'toast-top-left';
POSITION_TOP_CENTER = 'toast-top-center';
POSITION_TOP_FULL_WIDTH = 'toast-top-full-width';

POSITION_BOTTOM_RIGHT = 'toast-bottom-right';
POSITION_BOTTOM_LEFT = 'toast-bottom-left';
POSITION_BOTTOM_CENTER = 'toast-bottom-center';
POSITION_BOTTOM_FULL_WIDTH = 'toast-bottom-full-width';

```

Демонстрация
------------

[](#демонстрация)

- Demo can be found at

Дополнительно
-------------

[](#дополнительно)

- [Toastr by CodeSeven](https://github.com/CodeSeven/toastr)
- [Yii PHP Framework Version 2](https://github.com/yiisoft/yii2)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity68

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

Recently: every ~298 days

Total

8

Last Release

2253d ago

Major Versions

1.0.1 → 2.0.02015-11-05

### Community

Maintainers

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

---

Top Contributors

[![gitter-badger](https://avatars.githubusercontent.com/u/8518239?v=4)](https://github.com/gitter-badger "gitter-badger (1 commits)")

---

Tags

notificationjqueryyii2extensiontoastr

### Embed Badge

![Health badge](/badges/nikserg-yii2-toastr/health.svg)

```
[![Health](https://phpackages.com/badges/nikserg-yii2-toastr/health.svg)](https://phpackages.com/packages/nikserg-yii2-toastr)
```

###  Alternatives

[kartik-v/yii2-widget-growl

A widget to generate growl based notifications using bootstrap-growl plugin (sub repo split from yii2-widgets)

384.2M14](/packages/kartik-v-yii2-widget-growl)[kartik-v/yii2-widget-alert

A widget to generate alert based notifications using bootstrap-alert plugin (sub repo split from yii2-widgets)

284.1M24](/packages/kartik-v-yii2-widget-alert)[odaialali/yii2-toastr

This is the Toastr extension for Yii 2. It encapsulates Toastr plugin in terms of Yii widgets, and makes ajax notification easy to implement.

1486.3k](/packages/odaialali-yii2-toastr)[loveorigami/yii2-notification-wrapper

This module for renders a message from session flash (with ajax, pjax support and etc.)

77199.7k5](/packages/loveorigami-yii2-notification-wrapper)[diecoding/yii2-toastr

Simple flash toastr notifications for Yii2

1328.8k](/packages/diecoding-yii2-toastr)

PHPackages © 2026

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