S
S
Sergey Beloventsev2019-01-11 16:32:24
Yii
Sergey Beloventsev, 2019-01-11 16:32:24

How to order connection assets kartik?

I use a lot of widgets from kartik, but it became necessary to connect one script right after jquery in this way
in the main connected asset

public $depends = [
        'backend\assets\MyAssets',
        'backend\assets\MyYiiAssets',
        'kartik\base\AssetBundle'
    ];

here are the contents of MyAssets
public $basePath = '@webroot';
    public $baseUrl = '@web';
    public $js = [
        'js/main.min.js'
        ];
    public $depends = [
        'yii\web\JqueryAsset',
    ];

and MyYiiAssets
public $sourcePath = '@yii/assets';
    public $js = [
        'yii.js',
    ];

but wherever I connect widgets from Kartik everywhere I get one problem scripts from his assets are connected above mine i.e. first, the kartika dependencies are connected, and then my scripts.
The question is how to correctly connect jquery first, then mine and then all the other scripts.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question