PHPackages                             ischenko/yii2-jsloader - 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. [Templating &amp; Views](/categories/templating)
4. /
5. ischenko/yii2-jsloader

ActiveYii2-extension[Templating &amp; Views](/categories/templating)

ischenko/yii2-jsloader
======================

An Yii2 extension designed to handle JS files, code and asset bundles via various js loaders

v1.3.2(6y ago)11.1k12MITPHPPHP &gt;=7.1

Since Oct 17Pushed 6y ago1 watchersCompare

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

READMEChangelog (10)Dependencies (6)Versions (12)Used By (2)

yii2-jsloader
=============

[](#yii2-jsloader)

[![Latest Stable Version](https://camo.githubusercontent.com/ec2cb6b459afc57339d5d1463fcd8df2856ae86c21b4f45ebb0e42a8b99b6785/68747470733a2f2f706f7365722e707567782e6f72672f69736368656e6b6f2f796969322d6a736c6f616465722f762f737461626c65)](https://packagist.org/packages/ischenko/yii2-jsloader)[![Total Downloads](https://camo.githubusercontent.com/3cbf3a575836aa065e3f7fefff4c9f5acf4c1ea91c541bee42eba2c31c68b2aa/68747470733a2f2f706f7365722e707567782e6f72672f69736368656e6b6f2f796969322d6a736c6f616465722f646f776e6c6f616473)](https://packagist.org/packages/ischenko/yii2-jsloader)[![Build Status](https://camo.githubusercontent.com/c5ad94e52e9c9e429180b754e6eb61274b407472540faa9d2e9c1d8b03c5dbf8/68747470733a2f2f7472617669732d63692e6f72672f69736368656e6b6f2f796969322d6a736c6f616465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ischenko/yii2-jsloader)[![Code Climate](https://camo.githubusercontent.com/3c802042b8e743df5a18424664957cc4977bfbf8af3dc6bd6984b9704cd920c5/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f69736368656e6b6f2f796969322d6a736c6f616465722f6261646765732f6770612e737667)](https://codeclimate.com/github/ischenko/yii2-jsloader)[![Test Coverage](https://camo.githubusercontent.com/40cf8bdeb902b26cd28b1e025c9572e1e289af31453f793abd57689d9bf8c54c/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f69736368656e6b6f2f796969322d6a736c6f616465722f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/ischenko/yii2-jsloader/coverage)[![License](https://camo.githubusercontent.com/b5172888b0640a6ff3b8f0afc51a391f3cee7e6ee7b529318026b8eff6dd0fda/68747470733a2f2f706f7365722e707567782e6f72672f69736368656e6b6f2f796969322d6a736c6f616465722f6c6963656e7365)](https://packagist.org/packages/ischenko/yii2-jsloader)

An extension provides behavior which allows to process js files, code and asset bundles by various js loaders such as [RequireJS](http://requirejs.org).

Along with behavior it provides a set of interfaces and base classes for implementing a js loader.

Currently available implementations of js loaders are:

- [yii2-jsloader-requirejs](https://github.com/ischenko/yii2-jsloader-requirejs)
- [yii2-jsloader-systemjs](https://github.com/ischenko/yii2-jsloader-systemjs)

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

[](#installation)

\*Requires PHP &gt;= 7.1

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

Either run

```
composer require ischenko/yii2-jsloader

```

or add

```
"ischenko/yii2-jsloader": "*"
```

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

Usage
-----

[](#usage)

Add the behavior and concrete loader implementation to a view configuration

```
    ...
    'components' => [
        ...
        'view' => [
            'as jsLoader' => [
                'class' => 'ischenko\yii2\jsloader\Behavior',
                'loader' => [
                    'class' => 'loader\namespace\LoaderClass'
                ]
            ]
        ]
        ...
    ]
    ...
```

By default the loader skips scripts and bundles/files located in [the head section](http://www.yiiframework.com/doc-2.0/yii-web-view.html#POS_HEAD-detail), but if you need to include those scripts or exclude another section(s) you can do this via `ignorePositions` property:

```
    ...
    'components' => [
        ...
        'view' => [
            'as jsLoader' => [
                'class' => 'ischenko\yii2\jsloader\Behavior',
                'loader' => [
                    'class' => 'loader\namespace\LoaderClass',
                    'ignorePositions' => [
                        View::POS_HEAD,
                        View::POS_BEGIN
                    ]
                ]
            ]
        ]
        ...
    ]
    ...
```

Additionally you can set a list of an asset bundles that should be ignored by the loader via `ignoreBundles` property:

```
    ...
    'components' => [
        ...
        'view' => [
            'as jsLoader' => [
                'class' => 'ischenko\yii2\jsloader\Behavior',
                'loader' => [
                    'class' => 'loader\namespace\LoaderClass',
                    'ignoreBundles' => [
                        'app\assets\AppCssAsset'
                    ]
                ]
            ]
        ]
        ...
    ]
    ...
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity65

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

Recently: every ~6 days

Total

11

Last Release

2249d ago

PHP version history (3 changes)v1.0-rc.1PHP &gt;=5.4.0

v1.2PHP &gt;=7.2.0

v1.2.1PHP &gt;=7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1213046?v=4)[Roman Ishchenko](/maintainers/ischenko)[@ischenko](https://github.com/ischenko)

---

Top Contributors

[![ischenko](https://avatars.githubusercontent.com/u/1213046?v=4)](https://github.com/ischenko "ischenko (96 commits)")

---

Tags

viewyii2Behaviorassetsjsloader

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/ischenko-yii2-jsloader/health.svg)

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

###  Alternatives

[ogheo/yii2-htmlcompress

Compress HTML output into a single line

20184.4k1](/packages/ogheo-yii2-htmlcompress)[raoul2000/yii2-bootswatch-asset

Use Bootswatch theme in your Yii application with minimum effort

2145.0k4](/packages/raoul2000-yii2-bootswatch-asset)[raoul2000/yii2-workflow-view

A simple widget to display your workflows

1638.8k20](/packages/raoul2000-yii2-workflow-view)

PHPackages © 2026

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