PHPackages                             yidas/yii2-bower-asset - 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. yidas/yii2-bower-asset

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

yidas/yii2-bower-asset
======================

Bower Assets for Yii 2 app provided via Composer repository

2.0.13.1(6y ago)331.2M—5.6%13[2 issues](https://github.com/yidas/yii2-bower-asset/issues)[18 PRs](https://github.com/yidas/yii2-bower-asset/pulls)20MITJavaScript

Since Sep 19Pushed 3y ago1 watchersCompare

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

READMEChangelog (3)DependenciesVersions (23)Used By (20)

 [ ![](https://avatars0.githubusercontent.com/u/993323) ](https://github.com/yiisoft)

Yii 2 Core Bower Asset
======================

[](#yii-2-core-bower-asset)

Yii 2 core Bower packages for official Composer repository installation

[![Latest Stable Version](https://camo.githubusercontent.com/86ef83f0a5fea764cc943a4a3f4dc6a7535211fa5795e20b192504569dcd7aa3/68747470733a2f2f706f7365722e707567782e6f72672f79696461732f796969322d626f7765722d61737365742f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/yidas/yii2-bower-asset)[![License](https://camo.githubusercontent.com/b3cf66cc9d4d4be8046ba57d4387e762d8e1d242aeaa7ee03f2152b8caa0b92a/68747470733a2f2f706f7365722e707567782e6f72672f79696461732f796969322d626f7765722d61737365742f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/yidas/yii2-bower-asset)[![Total Downloads](https://camo.githubusercontent.com/b7735197de64ffabac9107c3536158d58b588d57615d9b36e412491073dce378/68747470733a2f2f706f7365722e707567782e6f72672f79696461732f796969322d626f7765722d61737365742f646f776e6c6f6164733f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/yidas/yii2-bower-asset)[![Monthly Downloads](https://camo.githubusercontent.com/39fe5c43772f10d2c146cc0d237383f3d71f950718615ff668114231650bd56b/68747470733a2f2f706f7365722e707567782e6f72672f79696461732f796969322d626f7765722d61737365742f642f6d6f6e74686c793f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/yidas/yii2-bower-asset)

FEATURES
--------

[](#features)

- ***Install or update Bower assets** for Yii 2 app via Composer **without any plugin** (Even v2.0.13 above)*
- ***Prevent the error of Bower packages** when using Composer install &amp; update for Yii2*

    > Problem 1
    >
    > \- yiisoft/yii2 2.0.12 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -&gt; no matching package found.
- ***Official install way** by using original Composer repository*

> Got tired of [fxp/composer-asset-plugin](https://github.com/fxpio/composer-asset-plugin)? It's a good project with nice idea and good implementation. But it has some issues: it slows down composer update a lot and requires global installation, so affects all projects. Also there are Travis and Scrutinizer integration special problems, that are a bit annoying.

Compare with [Asset Packagist](https://asset-packagist.org/), this package only for installing the Bower packages for Yii2 app by using original Composer repository, which goals to makes Bower separated from Composer .

### Supported Packages

[](#supported-packages)

This Bower asset supports Yii 2 core(`yiisoft/yii2`) such as widgets or validators.

For the Yii 2 application templates(`yii2-app-basic` &amp; `yii2-app-advanced`), this also supports `yii2-bootstrap` and others for dependent packages such as `yii2-debug` &amp; `yii2-gii`.

---

INSTALLATION
------------

[](#installation)

### 1. Require Package

[](#1-require-package)

In Yii2 `composer.json`, require `yidas/yii2-bower-asset` before `yiisoft/yii2`.

Example `composer.json`:

```
"require": {
    "php": ">=5.4.0",
    "yidas/yii2-bower-asset": "~2.0.5",
    "yiisoft/yii2": "~2.0.5",
    "yiisoft/yii2-bootstrap": "~2.0.0"
}

```

After above setting, you could run `composer require yidas/yii2-bower-asset` to install the package. It's same as [yidas/yii2-composer-bower-skip](https://github.com/yidas/yii2-composer-bower-skip) which makes composer to install and update for Yii2 without Bower plugin.

### 2. Set Up Application Config

[](#2-set-up-application-config)

In Yii2 application `config/web.php`, added an alias named `@bower` pointed to `@vendor/yidas/yii2-bower-asset/bower`:

```
$config = [
    ...
    'aliases' => [
        '@bower' => '@vendor/yidas/yii2-bower-asset/bower'
    ],
    ...
];
```

> This method is the better way with efficient and clean considering. Instead, you could also use installer to set up:
>
> [Install via Package Cloning Installer](#install-via-package-cloning-installer)
>
> [Install via Alias Setting Installer](#install-via-alias-setting-installer)

### 3. Remove Composer Asset-Packagist Repositories

[](#3-remove-composer-asset-packagist-repositories)

If you are using the version 2.0.13 or higher of Yii, you may remove the `repositories` setting of `composer.json` to use original Composer repository.

Example segament to delete in `composer.json` :

```
"repositories": [
    {
        "type": "composer",
        "url": "https://asset-packagist.org"
    }
]

```

*Finally*, command `composer update` then enjoy it.

---

CREATE PROJECT
--------------

[](#create-project)

If you doesn't has Yii2 project yet, choose one of below ways to create:

### Create Project via Composer

[](#create-project-via-composer)

You can use Composer to create Yii2 project by using following package:

#### [yidas/yii2-app-basic](https://github.com/yidas/yii2-app-basic)

[](#yidasyii2-app-basic)

```
composer create-project --prefer-dist yidas/yii2-app-basic

```

#### [yidas/yii2-app-advanced](https://github.com/yidas/yii2-app-advanced)

[](#yidasyii2-app-advanced)

```
composer create-project --prefer-dist yidas/yii2-app-advanced

```

These packages are Yii 2 Application Template with fixed Bower, which including [`yidas/yii2-bower-asset`](https://github.com/yidas/yii2-bower-asset) already.

### Creating Project from Official Site

[](#creating-project-from-official-site)

You could download Yii2 project from official [Archive File](http://www.yiiframework.com/download/), then manally install `yii2-bower-asset` on it by following above instruction.

---

INSTALLER USAGE
---------------

[](#installer-usage)

If you don't want to [Set Up Application Config](#2-set-up-application-config) but use installer instead, there are some ways you could chooses one of them to install:

#### Install via Package Cloning Installer

[](#install-via-package-cloning-installer)

In Yii2 `composer.json`, add script `yidas\\yii2BowerAsset\\Installer::bower` in `post-package-install` &amp; `post-package-update` event.

```
"scripts": {
    "post-package-install": [
         "yidas\\yii2BowerAsset\\Installer::clone"
    ],
    "post-package-update": [
         "yidas\\yii2BowerAsset\\Installer::clone"
    ]
}

```

#### Install via Alias Setting Installer

[](#install-via-alias-setting-installer)

In Yii2 `composer.json`, add script `yidas\\yii2BowerAsset\\Installer::setAlias` in `post-update-cmd` event.

```
"scripts": {
    "post-package-install": [
         "yidas\\yii2BowerAsset\\Installer::setAlias"
    ],
    "post-package-update": [
         "yidas\\yii2BowerAsset\\Installer::setAlias"
    ],
    "unset-yii2-bower-asset": [
        "yidas\\yii2BowerAsset\\Installer::unsetAlias"
    ]
}

```

> This installation will modify Yii2 file, you can run `composer run-script unset-yii2-bower-asset` to recover back.

---

LIMITATION
----------

[](#limitation)

***Do not use Bower mixed with Composer project*** is the goal of this package.

1. The variety of Bower packages are just for Yii2 cores.
2. The versions of Bower packages are fixed to current Yii2 version.
3. If you are requiring other Bower packages in Yii2, you could set the config fit to this package or not to use.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity52

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 78.6% 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 ~243 days

Total

4

Last Release

2433d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b30d2b2c0b53aef65fad4af56cd3c7912d3db2b612890c706fe79448717f6aba?d=identicon)[yidas](/maintainers/yidas)

---

Top Contributors

[![yidas](https://avatars.githubusercontent.com/u/12604195?v=4)](https://github.com/yidas "yidas (11 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")

---

Tags

bower-assetcomposerpackagistyii2frameworkyii2bowerbower asset

### Embed Badge

![Health badge](/badges/yidas-yii2-bower-asset/health.svg)

```
[![Health](https://phpackages.com/badges/yidas-yii2-bower-asset/health.svg)](https://phpackages.com/packages/yidas-yii2-bower-asset)
```

###  Alternatives

[yidas/yii2-composer-bower-skip

A Composer package that allows you to install or update Yii2 without Bower-Asset

47723.5k32](/packages/yidas-yii2-composer-bower-skip)[tecnocen/yii2-formgenerator

Yii 2 Library to configure form generator

145.7k](/packages/tecnocen-yii2-formgenerator)

PHPackages © 2026

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