2017 © Pedro Peláez
 

yii2-extension yii2-jsloader

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

image

ischenko/yii2-jsloader

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

  • Tuesday, November 15, 2016
  • by ischenko
  • Repository
  • 1 Watchers
  • 1 Stars
  • 88 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 7 % Grown

The README.md

yii2-jsloader

Latest Stable Version Total Downloads Build Status Code Climate Test Coverage License, (*1)

An extension provides behavior which allows to process js files, code and asset bundles by various js loaders such as RequireJS., (*2)

Along with behavior it provides a set of interfaces and base classes for implementing a js loader., (*3)

Currently available implementations of js loaders are: - yii2-jsloader-requirejs - yii2-jsloader-systemjs, (*4)

Installation

*Requires PHP >= 7.1, (*5)

The preferred way to install this extension is through composer., (*6)

Either run, (*7)

composer require ischenko/yii2-jsloader

or add, (*8)

"ischenko/yii2-jsloader": "*"

to the require section of your composer.json., (*9)

Usage

Add the behavior and concrete loader implementation to a view configuration, (*10)

    ...
    '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, but if you need to include those scripts or exclude another section(s) you can do this via ignorePositions property:, (*11)

    ...
    '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:, (*12)

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

The Versions

15/11 2016

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Roman Ishchenko

yii2 assets behavior view jsloader

28/10 2016

v1.1

1.1.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Roman Ishchenko

yii2 assets behavior view jsloader

24/10 2016

v1.0

1.0.0.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Roman Ishchenko

yii2 assets behavior view jsloader

24/10 2016

v1.0-rc.2

1.0.0.0-RC2

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Roman Ishchenko

yii2 assets behavior view jsloader

17/10 2016

v1.0-rc.1

1.0.0.0-RC1

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

  Sources   Download

MIT

The Requires

 

The Development Requires

by Roman Ishchenko

yii2 assets behavior view jsloader