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

Maintainers

Package info

github.com/yii2-framework/jquery

Language:JavaScript

pkg:composer/yii2-framework/jquery

Statistics

Installs: 884

Dependents: 1

Suggesters: 0

Stars: 1

Open Issues: 0

dev-main / 0.1.x-dev 2026-03-28 18:20 UTC

This package is auto-updated.

Last update: 2026-03-28 18:23:53 UTC


README

Yii Framework

jQuery


PHPUnit Mutation Testing PHPStan

Optional jQuery integration layer for yii2-framework/core
Asset bundles, client-side validation scripts, and widget client scripts — all jQuery-backed

Features

Feature Overview

Quick start

Installation

composer require yii2-framework/jquery

Asset installation

This package uses php-forge/foxy to install npm dependencies (jQuery, Inputmask, etc.) automatically 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
        }
    }
}
  1. Run composer update to trigger the asset merge.

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 all validators and widgets that support the strategy pattern. No other configuration is required.

Overriding a single validator

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

Package information

PHP Latest Stable Version Total Downloads

Quality code

Codecov PHPStan Level Max Super-Linter StyleCI

Our social networks

Follow on X

License

License