G
G
Grag2014-07-13 23:11:11
JavaScript
Grag, 2014-07-13 23:11:11

Yii2 how to change js connection order?

Actually the question is in the title. Thanks in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Flaker, 2014-07-14
@Grag

If js files are connected via Asset Manager then www.yiiframework.com/doc-2.0/guide-assets.html
That is, you create your own AssetManager inherited from AssetBundle and register it ( registerAssetBundle ).
Well, or you can just write everything in the header)

A
Alexey, 2014-07-15
@azovl

If dynamically loaded, then this is how you can:
Read:
registerJs()-detail
registerJsFile()-detail

$search = <<< JS
                       ... your JS code here
JS;
        $this->registerJs($search, View::POS_READY);
        // where $position can be View::POS_READY (the default),
        // or View::POS_HEAD, View::POS_BEGIN, View::POS_END
        ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question