PHPackages                             yii2-framework/jquery - 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. yii2-framework/jquery

ActiveLibrary

yii2-framework/jquery
=====================

jQuery integration layer for yii2-framework/core asset bundles, client validation scripts, and widget client scripts.

1203↑2855.7%JavaScriptCI passing

Since Mar 28Pushed 1mo agoCompare

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

READMEChangelogDependenciesVersions (3)Used By (0)

    ![Yii Framework](https://camo.githubusercontent.com/6f0a7c6c5e9ed8d389db5c82af26a2f70418756b736357378178997e52296488/68747470733a2f2f7777772e7969696672616d65776f726b2e636f6d2f696d6167652f64657369676e2f6c6f676f2f796969335f66756c6c5f666f725f6461726b2e737667)

jQuery
======

[](#jquery)

 [ ![PHPUnit](https://camo.githubusercontent.com/684691cd6e5197f1c942f01efef4700fdf1f6f4b9e6bffc25945cdf5016ec5a9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f796969322d6672616d65776f726b2f6a71756572792f6275696c642e796d6c3f7374796c653d666f722d7468652d6261646765266c6f676f3d676974687562266c6162656c3d504850556e6974) ](https://github.com/yii2-framework/jquery/actions/workflows/build.yml) [ ![Mutation Testing](https://camo.githubusercontent.com/fa728f454addc3a2746a653e8f1e3966dec604d7c54f152de3d762e60b553aa9/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666f722d7468652d62616467652675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d253246796969322d6672616d65776f726b2532466a71756572792532466d61696e) ](https://dashboard.stryker-mutator.io/reports/github.com/yii2-framework/jquery/main) [ ![PHPStan](https://camo.githubusercontent.com/15924ee472a88d18b4e4cacf5968b85a5a17db41371c7c5f2d847833fcf5e5af/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f796969322d6672616d65776f726b2f6a71756572792f7374617469632e796d6c3f7374796c653d666f722d7468652d6261646765266c6f676f3d676974687562266c6162656c3d5048505374616e) ](https://github.com/yii2-framework/jquery/actions/workflows/static.yml)

 **Optional jQuery integration layer for [Yii2](https://github.com/yii2-framework/yii2)**
 *Asset bundles, client-side validation scripts, and widget client scripts all jQuery-backed*

Overview
--------

[](#overview)

This package restores the jQuery-powered client-side layer that was extracted from `yii2-framework/yii2`.

The package supports **jQuery 3.7.1** and **jQuery 4.0.0**. The bundled npm dependency defaults to jQuery `3.7.1` so legacy Yii2 applications remain safe by default. Applications that want jQuery `4.0.0` must pin it explicitly in their project-level `package.json`.

Install it when your application still relies on classic Yii2 page flows such as:

- `yii.js` data-method, confirmation, and CSRF helpers;
- `ActiveForm` client-side and Ajax validation;
- `GridView` filtering and checkbox selection scripts;
- `Captcha`, `MaskedInput`, and `Pjax` jQuery integrations.

The package is intentionally optional. Applications that no longer need jQuery should avoid installing it and should provide an alternative client-side integration strategy instead.

Features
--------

[](#features)

  ![Feature Overview](./docs/svgs/features-mobile.svg)Quick start
-----------

[](#quick-start)

### Installation

[](#installation)

```
composer require yii2-framework/jquery:^0.1
```

### Asset installation

[](#asset-installation)

This package uses [php-forge/foxy](https://github.com/php-forge/foxy) to install npm dependencies such as jQuery, Inputmask, and Punycode during `composer install` or `composer update`.

The `@npm` alias must point to your project's `node_modules` directory:

```
// config/web.php
return [
    'aliases' => [
        '@npm' => dirname(__DIR__) . '/node_modules',
    ],
    // ...
];
```

If npm packages are not installed automatically, verify that:

1. `php-forge/foxy` is allowed in your `composer.json`:

```
{
    "config": {
        "allow-plugins": {
            "php-forge/foxy": true
        }
    }
}
```

2. Run `composer update` to trigger the asset merge.

### jQuery version selection

[](#jquery-version-selection)

By default, this package installs jQuery `3.7.1`.

If your application is ready to run on jQuery `4.0.0`, pin it explicitly in the project-level `package.json` and run `composer update` again so the merged npm manifest is refreshed:

```
{
    "dependencies": {
        "jquery": "^4.0.0"
    }
}
```

Use the full jQuery build. This package depends on Ajax and Deferred APIs and is not compatible with the slim build.

### Configuration

[](#configuration)

Register the bootstrap class in your application configuration:

```
// config/web.php
return [
    'bootstrap' => [\yii\jquery\Bootstrap::class],
    // ...
];
```

`Bootstrap` configures the DI container with jQuery-based `$clientScript` defaults for validators and widgets that support strategy-based client integrations.

### Overriding a single validator

[](#overriding-a-single-validator)

```
public function rules(): array
{
    return [
        [
            'email',
            'required',
            'clientScript' => ['class' => MyCustomRequiredClientScript::class],
        ],
    ];
}
```

When to use this package
------------------------

[](#when-to-use-this-package)

Use `yii2-framework/jquery` when your application still renders classic Yii2 views and depends on jQuery-backed widget behavior or client validation.

Do not use this package as the foundation for a new frontend modernization effort. When migrating away from jQuery, the recommended direction is to keep this package only on legacy pages and introduce a separate frontend integration layer for new pages.

Documentation
-------------

[](#documentation)

- 📚 [Installation Guide](docs/installation.md)
- ⚙️ [Configuration Reference](docs/configuration.md)
- 💡 [Usage Examples](docs/examples.md)
- 🧪 [Testing Guide](docs/testing.md)

Package information
-------------------

[](#package-information)

[![PHP](https://camo.githubusercontent.com/9e9dabf3cf02992f5f7927dc70dcc68e92fe493a8a5ae3b546c78a2d40996d9b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f253345253344382e322d3737374242342e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://www.php.net/releases/8.2/en.php)[![Latest Stable Version](https://camo.githubusercontent.com/e2510308229e10739d5d2f55554053584cb975d7e1b3120273a7d7781825d841/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f796969322d6672616d65776f726b2f6a71756572792e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465266c6162656c3d537461626c65)](https://packagist.org/packages/yii2-framework/jquery)[![Total Downloads](https://camo.githubusercontent.com/1f87cbdc1fbed2fc2dca7b196142abf8d752490bf9533d300201dd2df3e87690/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f796969322d6672616d65776f726b2f6a71756572792e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d636f6d706f736572266c6f676f436f6c6f723d7768697465266c6162656c3d446f776e6c6f616473)](https://packagist.org/packages/yii2-framework/jquery)

Quality code
------------

[](#quality-code)

[![Codecov](https://camo.githubusercontent.com/1972ec848670aee13a6c907f77243edc97df178a54a53fb420406be68fe5acc7/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f796969322d6672616d65776f726b2f6a71756572792e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d636f6465636f76266c6f676f436f6c6f723d7768697465266c6162656c3d436f766572616765)](https://codecov.io/github/yii2-framework/jquery)[![PHPStan Level Max](https://camo.githubusercontent.com/2bd4562df4b647d28fd5c868f51fb5f15792e0fa49876798ef66c85c61a0d9bf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c2532304d61782d3446354439352e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://github.com/yii2-framework/jquery/actions/workflows/static.yml)[![Super-Linter](https://camo.githubusercontent.com/daa57cb1d9f96505b9a795451c74d928177d3b1505b6108bc13b80508cb9cfec/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f796969322d6672616d65776f726b2f6a71756572792f6c696e7465722e796d6c3f7374796c653d666f722d7468652d6261646765266c6162656c3d53757065722d4c696e746572266c6f676f3d676974687562)](https://github.com/yii2-framework/jquery/actions/workflows/linter.yml)[![StyleCI](https://camo.githubusercontent.com/e8c949a07561fd257373f0d92870e3605c859ccca4b75b25fa05a2d01eee6d25/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5374796c6543492d5061737365642d3434434331312e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d7374796c656369266c6f676f436f6c6f723d7768697465)](https://github.styleci.io/repos/yii2-framework/jquery?branch=main)

Our social networks
-------------------

[](#our-social-networks)

[![Follow on X](https://camo.githubusercontent.com/332c1b1e043dfb940b95825f7863dc473f6924ddacdd6738cbbbba08f49e1862/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2d466f6c6c6f772532306f6e253230582d3144413146322e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d78266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d303030303030)](https://x.com/Terabytesoftw)

License
-------

[](#license)

[![License](https://camo.githubusercontent.com/680c8d62ba2d5a71d7099b6e81114fb0b22d99086c121fd178e1149afc669d44/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4253442d2d332d2d436c617573652d627269676874677265656e2e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d6f70656e736f75726365696e6974696174697665266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d353535353535)](LICENSE)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance61

Regular maintenance activity

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/524d2b46690f41fce7188d369488a35e7624e6c5a264d82aacd08548bfd156ab?d=identicon)[terabytesoftw](/maintainers/terabytesoftw)

---

Top Contributors

[![terabytesoftw](https://avatars.githubusercontent.com/u/42547589?v=4)](https://github.com/terabytesoftw "terabytesoftw (14 commits)")

---

Tags

activeformasset-bundlesclient-validationgridviewjqueryjquery4phppjaxwidgetsyii2

### Embed Badge

![Health badge](/badges/yii2-framework-jquery/health.svg)

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

PHPackages © 2026

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