PHP code example of ischenko / yii2-jsloader

1. Go to this page and download the library: Download ischenko/yii2-jsloader library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ischenko / yii2-jsloader example snippets


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

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

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