M
M
Monitorkin2016-04-26 02:19:57
Yii
Monitorkin, 2016-04-26 02:19:57

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()]]);

what to replace @web with so that there are no absolute paths, for a simple transfer of the module across projects?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2016-04-26
@Monitorkin

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 question

Ask a Question

731 491 924 answers to any question