Answer the question
In order to leave comments, you need to log in
How to include scripts from subfolder of YII2 module?
I wrote a module and created a js folder inside for module scripts.
How can I connect scripts from this folder to the view?
Before that, the scripts were in the web/js/ folder and connected like this:
$this->registerJsFile('@web/js/test.js', ['depends' => [\yii\web\JqueryAsset::className()]]);
Answer the question
In order to leave comments, you need to log in
Use it better to register all scripts of the AssetBundle module, because you not only need to include the file but also publish it in a public folder
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question