PHPackages                             nozzha/yii2-ajaxy - 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. nozzha/yii2-ajaxy

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

nozzha/yii2-ajaxy
=================

Nozzha Ajaxy - Actions Dialog via Ajax extension for Yii 2

v2.0(11y ago)3231MITJavaScript

Since Feb 12Pushed 11y ago3 watchersCompare

[ Source](https://github.com/nozzha/yii2-ajaxy)[ Packagist](https://packagist.org/packages/nozzha/yii2-ajaxy)[ RSS](/packages/nozzha-yii2-ajaxy/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (7)Used By (0)

Nozzha Ajaxy 2.0: Actions Dialog via Ajax for Yii 2
===================================================

[](#nozzha-ajaxy-20-actions-dialog-via-ajax-for-yii-2)

Nozzha Ajaxy is a [Yii 2.0](http://www.yiiframework.com/) extension that provides a simple API to show an action via a dialog box in the page using the Bootstrap plugin [Bootbox](http://bootboxjs.com/).

Ajaxy was designed to display either a create or an update actions dialog box. In other words, an action that has a single form.

> *Note:* Ajaxy was not tested with actions that does not have a form like a `view` or `index` action.

For license information check the [LICENSE](LICENSE.md)-file.

[![Latest Stable Version](https://camo.githubusercontent.com/4a1be9cc28742b3af85928aabb56ac2cd1c3329b34bb3c92663323f8c0e38714/68747470733a2f2f706f7365722e707567782e6f72672f6e6f7a7a68612f796969322d616a6178792f762f737461626c65)](https://packagist.org/packages/nozzha/yii2-ajaxy)[![Total Downloads](https://camo.githubusercontent.com/fb74478aa2a5bdf6ed3d0b88dfe0a80c16703aa8f69be80b58f4554b46c55450/68747470733a2f2f706f7365722e707567782e6f72672f6e6f7a7a68612f796969322d616a6178792f646f776e6c6f616473)](https://packagist.org/packages/nozzha/yii2-ajaxy)[![Latest Unstable Version](https://camo.githubusercontent.com/2049006a890d8fa8905b3fa0d88e1b2376775665cd49e9addc1fa12be95be798/68747470733a2f2f706f7365722e707567782e6f72672f6e6f7a7a68612f796969322d616a6178792f762f756e737461626c65)](https://packagist.org/packages/nozzha/yii2-ajaxy)[![License](https://camo.githubusercontent.com/61cfc29385248a300e2d6f914328862c22e523d4e3abf38626ccc66e431a7796/68747470733a2f2f706f7365722e707567782e6f72672f6e6f7a7a68612f796969322d616a6178792f6c6963656e7365)](https://packagist.org/packages/nozzha/yii2-ajaxy)

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist nozzha/yii2-ajaxy

```

or add

```
"nozzha/yii2-ajaxy": "~1.0"
```

to the require section of your composer.json.

Usage
-----

[](#usage)

There are two steps for using Ajaxy

### 1. Handle Ajaxy requests

[](#1-handle-ajaxy-requests)

#### 1.1. Preparing the View

[](#11-preparing-the-view)

For Ajaxy to display the dialog box of the requested action, it will need to request for the view content first, and to retrieve the view at the proper time and request

You'll first use `Ajaxy::isAjaxy()` to check if this is an Ajaxy request that asks for the view content, and then return the content using [`Controller::renderAjax()`](http://www.yiiframework.com/doc-2.0/yii-web-controller.html#renderAjax()-detail).

Example:

in the controller

```
if (Ajaxy::isAjaxy()) {
    return $this->renderAjax('create', $params);
}
```

and in the view (in our example `create.php`) attach Ajaxy to the form using `Ajaxy::attachTo($view, $activeForm)`

> *Note:* You should set an id for the form to avoid duplicate ids when requesting the view via Ajax

Example:

```

...

```

#### 1.2. Handle the submitted form and return the response

[](#12-handle-the-submitted-form-and-return-the-response)

When the submits the form, Ajaxy will post it via `ajax` to the specified `action`, and you may need to handle this request differently to return the proper response.

Ajaxy provides to methods to do so, `Ajaxy::isSubmitted()` that checks whether the Ajaxy form has submitted. And `Ajaxy::response()` that prepares a response for the Ajaxy request.

Example:

```
if (Ajaxy::isSubmitted()) {
    // Handle model validation create, update or save ...
    return Ajaxy::response($status, $data);
}
```

And now the action is ready to provide it's view and to handle the submitted form.

### 2. Display the Dialog Box

[](#2-display-the-dialog-box)

#### 1. Register Ajaxy assets

[](#1-register-ajaxy-assets)

To link the JavaScript api of Ajaxy register it's asset bundle

```
Ajaxy::registerAssets($view);
```

#### 2. Show the Dialog

[](#2-show-the-dialog)

and then in your JavaScript code call `$ajaxy.showModalForm(options)`to show a dialog box of a view that you want to display

Example:

```
$ajaxy.showModalForm({
    url: 'http://example.com/controller/action',
    data: {
        User: { displayName: 'User Name' }
    },
    onResult: function (result) {
        console.log(result.data);
        // console.log("Created User #" + result.data.ID); // Example
    }
});
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

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

Total

4

Last Release

4035d ago

Major Versions

0.2-alpha → v1.02015-04-28

v1.0 → v2.02015-05-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/4d39141db08a7da6d1630a0f3a4c1f7ca7eed56a2ecc3e51540653eab0fe472f?d=identicon)[EmadOmar](/maintainers/EmadOmar)

---

Top Contributors

[![emadzz](https://avatars.githubusercontent.com/u/4407763?v=4)](https://github.com/emadzz "emadzz (37 commits)")

---

Tags

yii2extensionformajaxyajax-formform-dialog

### Embed Badge

![Health badge](/badges/nozzha-yii2-ajaxy/health.svg)

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

###  Alternatives

[kartik-v/yii2-widget-typeahead

Enhanced Yii2 wrapper for the Twitter Typeahead plugin (sub repo split from yii2-widgets).

454.8M9](/packages/kartik-v-yii2-widget-typeahead)[kartik-v/yii2-widget-rating

A Yii2 widget for the simple yet powerful bootstrap-star-rating plugin with fractional rating support (sub repo split from yii2-widgets)

444.1M8](/packages/kartik-v-yii2-widget-rating)[kartik-v/yii2-widget-colorinput

An enhanced Yii 2 widget encapsulating the HTML 5 color input (sub repo split from yii2-widgets)

324.8M10](/packages/kartik-v-yii2-widget-colorinput)[kartik-v/yii2-label-inplace

A form enhancement widget for Yii2 allowing in-field label support.

1181.2k](/packages/kartik-v-yii2-label-inplace)

PHPackages © 2026

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