PHPackages                             pa3py6aka/yii2-modal-alert-widget - 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. pa3py6aka/yii2-modal-alert-widget

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

pa3py6aka/yii2-modal-alert-widget
=================================

Modal alert widget for Yii2

1.4.0(4y ago)22.7k1MITPHP

Since Sep 14Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/all-sav/yii2-modal-alert-widget)[ Packagist](https://packagist.org/packages/pa3py6aka/yii2-modal-alert-widget)[ RSS](/packages/pa3py6aka-yii2-modal-alert-widget/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (13)Used By (0)

Yii2 Modal Alert Widget
=======================

[](#yii2-modal-alert-widget)

[![Latest Stable Version](https://camo.githubusercontent.com/a375d4a1c60efe5bc619e725c50f6d364f4ee6738d52e44342a0fe159a76b6e7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706133707936616b612f796969322d6d6f64616c2d616c6572742d7769646765742e737667)](https://packagist.org/packages/pa3py6aka/yii2-modal-alert-widget)[![License](https://camo.githubusercontent.com/0747de039210fc1e9ee135023a86eb32dce5addd0c7a55a2fc24b88d46fc14df/68747470733a2f2f706f7365722e707567782e6f72672f706133707936616b612f796969322d6d6f64616c2d616c6572742d7769646765742f6c6963656e7365)](https://packagist.org/packages/pa3py6aka/yii2-modal-alert-widget)[![Total Downloads](https://camo.githubusercontent.com/705f84bdebaa7c1f6b7ad7144cb6ee294d98949c9ccc16b06d12f0bda8351eb2/68747470733a2f2f706f7365722e707567782e6f72672f706133707936616b612f796969322d6d6f64616c2d616c6572742d7769646765742f646f776e6c6f616473)](https://packagist.org/packages/pa3py6aka/yii2-modal-alert-widget)[![Monthly Downloads](https://camo.githubusercontent.com/b446a13294621697e79b068e67fb09ffc02c19cf8ed1e7f274974c99e70906e7/68747470733a2f2f706f7365722e707567782e6f72672f706133707936616b612f796969322d6d6f64616c2d616c6572742d7769646765742f642f6d6f6e74686c79)](https://packagist.org/packages/pa3py6aka/yii2-modal-alert-widget)[![Daily Downloads](https://camo.githubusercontent.com/d1c99b6828be2f3878d9011482f62c5d3a077735a01be66887cafa6fdd06a129/68747470733a2f2f706f7365722e707567782e6f72672f706133707936616b612f796969322d6d6f64616c2d616c6572742d7769646765742f642f6461696c79)](https://packagist.org/packages/pa3py6aka/yii2-modal-alert-widget)

This widget show bootstrap modal or magnific popup when you set session flash message.

Supports all bootstrap versions - 3,4 and 5.

For magnific popups you must install magnific js before using this widget -

And for bootstrap modals of course you must set up bootstrap in your project.

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

[](#installation)

Install with composer:

```
composer require pa3py6aka/yii2-modal-alert-widget

```

or add

```
"pa3py6aka/yii2-modal-alert-widget": "^1.4"

```

to the require section of your composer.json file.

Usage
-----

[](#usage)

In controller set flash message:

```
Yii::$app->session->setFlash('success', 'My Message');

```

In your layout view show this widget:

```

...

```

By default widget using bootstrap 4 modal. Use `type` property to switch to another modal type:

```

```

You can set flashes with titles:

```
Yii::$app->session->setFlash('error', [['My Title', 'My Message']]);

```

Available options
-----------------

[](#available-options)

`type` - Type of alert - bootstrap 3/4/5 jquery or magnific popup, defaults to bootstrap 4. Bootstrap 5 type has two versions - with jQuery enabled and without jQuery. Use declared constants to set type (like `ModalAlert::TYPE_BOOTSTRAP_5_JQUERY`). See available types in source code.

`popupCssClass` - CSS class for modal(popup).

`popupId` - Modal(popup) ID.

`magnificPopupType` - Type of magnific popup, defaults to *"inline"*. See available types in official magnific popup guide.

`popupView` - Path to your custom view for render modal(popup). You can copy original view from `vendor/pa3py6aka/yii2-modal-alert-widget/src/views` and customize it.

`showTime` - Time in seconds after which the modal window will be automatically closed (`0` means that modal will be closed only by user)

`modalSize` - Bootstrap Modal size, available size `modal-sm`, `modal-lg`, `modal-xl`, and `modal-fullscreen` (for Bootstrap 5 only), default to `''`

Example
-------

[](#example)

```

```

Then, set flash:

```
Yii::$app->session->setFlash('error', [['Terrible mistake!', "Sorry, you can't sign up, because your karma is very small"]]);

```

And we get: [![Alt text](https://camo.githubusercontent.com/41383a4f3290e914044b160f4b95cfb0f076b6964bf911be72ddc68edb4d7137/687474703a2f2f7265732e636c6f7564696e6172792e636f6d2f706133707936616b612f696d6167652f75706c6f61642f76313531303837333931312f6578616d706c652d73637265656e5f647a71766b6f2e706e67 "Example modal")](https://camo.githubusercontent.com/41383a4f3290e914044b160f4b95cfb0f076b6964bf911be72ddc68edb4d7137/687474703a2f2f7265732e636c6f7564696e6172792e636f6d2f706133707936616b612f696d6167652f75706c6f61642f76313531303837333931312f6578616d706c652d73637265656e5f647a71766b6f2e706e67)

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance57

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 94.7% 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 ~139 days

Recently: every ~281 days

Total

12

Last Release

1635d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7ee78ceb0ff26357aa649a02eb7ef5983758c7df4ee2ec51f455d6da5e46fe8a?d=identicon)[pa3py6aka](/maintainers/pa3py6aka)

---

Top Contributors

[![all-sav](https://avatars.githubusercontent.com/u/12895355?v=4)](https://github.com/all-sav "all-sav (18 commits)")[![biladina](https://avatars.githubusercontent.com/u/10651085?v=4)](https://github.com/biladina "biladina (1 commits)")

---

Tags

yii2yii 2modal alert

### Embed Badge

![Health badge](/badges/pa3py6aka-yii2-modal-alert-widget/health.svg)

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

###  Alternatives

[softark/yii2-dual-listbox

Bootstrap Dual Listbox Widget for Yii 2

20144.4k11](/packages/softark-yii2-dual-listbox)

PHPackages © 2026

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