PHPackages                             siripravi/modal - 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. [Framework](/categories/framework)
4. /
5. siripravi/modal

ActiveYii2-extension[Framework](/categories/framework)

siripravi/modal
===============

Extension for the Yii2 framework

09JavaScript

Since May 29Pushed 1y agoCompare

[ Source](https://github.com/siripravi/yii2-modal-form)[ Packagist](https://packagist.org/packages/siripravi/modal)[ RSS](/packages/siripravi-modal/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Yii2 Ajax modal form
====================

[](#yii2-ajax-modal-form)

Description
-----------

[](#description)

This extension allows you to quickly add full-featured modal forms to your appllication. Main featues are:

1. Based on bootstrap modal forms.
2. Allows quickly add behavior to interact with viewing and updating data in modal dialogs.
3. Catch form post events, converts them to ajax request and display results in the same modal dialog.

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

To install, either run

```
$ php composer.phar require siripravi/modal "*"

```

or add

```
"siripravi/modal": "*"

```

to the `require` section of your `composer.json` file.

Usage
-----

[](#usage)

Somewhere in the main layout

```
\siripravi\modal\ModalForm::widget([
    'selector' => '.modal-form',
]);
```

Whenever you want to add behavior to tag a, just add class 'modal-form'

```
    echo Html::a('Some modal action', ['controller/action'], ['class' => 'modal-form']);
```

To improve traffic data and error exceptions you need to control layout rendering when ajax requests. I recommend you to override default rendering in your controllers:

```
class Controller extends \yii\web\Controller
{
    /**
     * Exclude layout rendering when ajax requests
     */
    public function render($view, $params = [])
    {
        if (\Yii::$app->request->isAjax) {
            return $this->renderPartial($view, $params);
        }
        return parent::render($view, $params);
    }
}
```

### Client Options

[](#client-options)

To add client options use `clientOptions` key. Available client options are: `id`, `class`, `tabindex`.

- Id key **replaces** existing auto generated id attribute.
- Class key **adds** classes to html class attribute.
- Tabindex key **replaces** existing default tabindex html attribute (-1), when false, then no tabindex attribute appears.

```
\siripravi\modal\ModalForm::widget([
    'selector' => '.modal-form',
    'clientOptions' => [
        'id' => 'sample-unique-id',
        'class' => 'sample-class1 sample-class2',
        'tabindex' => false
    ]
]);

```

License
-------

[](#license)

**siripravi/modal** is released under the MIT License. See the bundled `LICENSE` for details.

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 Bus Factor1

Top contributor holds 85.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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/635f6e9d00421cfc2eae6b8dd3e12a6229eaa3eafa0cb23702a15edef7b215bd?d=identicon)[siripravi](/maintainers/siripravi)

---

Top Contributors

[![borodulin](https://avatars.githubusercontent.com/u/8121448?v=4)](https://github.com/borodulin "borodulin (42 commits)")[![siripravi](https://avatars.githubusercontent.com/u/174201?v=4)](https://github.com/siripravi "siripravi (5 commits)")[![paskuale75](https://avatars.githubusercontent.com/u/9800?v=4)](https://github.com/paskuale75 "paskuale75 (2 commits)")

### Embed Badge

![Health badge](/badges/siripravi-modal/health.svg)

```
[![Health](https://phpackages.com/badges/siripravi-modal/health.svg)](https://phpackages.com/packages/siripravi-modal)
```

###  Alternatives

[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k39.6M299](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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