PHP code example of ischenko / yii2-jsloader-systemjs

1. Go to this page and download the library: Download ischenko/yii2-jsloader-systemjs 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-systemjs example snippets


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

     ...
     'components' => [
         ...
         'view' => [
             'as jsLoader' => [
                 'class' => 'ischenko\yii2\jsloader\Behavior',
                 'loader' => [
                     'minimal' => false,
                     'extras' => ['amd'],
                     'position' => \yii\web\View::POS_HEAD,
                     'class' => 'ischenko\yii2\jsloader\SystemJs',
                 ]
             ]
         ]
         ...
     ]
     ...
 

class jQueryFireflyAsset extends AssetBundle
{
    public $js
        = [
            'jquery.firefly.min.js'
        ];

    public $jsOptions
        = [
            'systemjs' => [
                'alias' => 'jqff',
                'exports' => 'jquery_firefly'
            ]
        ];

    public $depends
        = [
            'yii\web\JqueryAsset',
        ];
}