Answer the question
In order to leave comments, you need to log in
Why is yii2 not reading jquery file?
public $js = [
'js/jquery3-3-1.min.js',
'js/style.js',
];
Answer the question
In order to leave comments, you need to log in
If your AppAsset depends on YiiAsset, then keep in mind that YiiAsset already depends on the framework's built-in JqueryAsset. This way you include two jquery.
You can explicitly specify in the configuration that your jquery should be used instead of JqueryAsset :
'assetManager' => [
'bundles' => [
'yii\web\JqueryAsset' => [
'sourcePath' => '@frontend/assets',
'js' => [
'js/my-jquery.js',
],
],
],
],
yii doesn't have to read anything, it includes files. So you need to check whether you have connected it and if not, check whether it is there from where you connect it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question