Answer the question
In order to leave comments, you need to log in
How to disable automatic js insertion in Yii2?
Using, for example, ActiveForm, js is automatically inserted
Answer the question
In order to leave comments, you need to log in
<?php $form = ActiveForm::begin(['enableClientScript' => false]); ?>
Disabled in AssetBundle:
public $depends = [
//'yii\web\YiiAsset',
//'yii\bootstrap\BootstrapAsset',
];
'assetManager' => [
'bundles' => [
'yii\bootstrap\BootstrapAsset' => [
'basePath' => '@webroot',
'baseUrl' => '/',
'css' => [],
'js' => [],
'sourcePath' => null,
],
'yii\web\JqueryAsset' => [
'sourcePath' => null,
'js' => [],
],
'yii\web\BootstrapPluginAsset' => [
'sourcePath' => null,
'js' => [],
],
],
],
You can disable one or more resource bundles by associating false with the names of the resource bundles you want to disable.
Setting Up Resource Kits
'assetManager' => [
'bundles' => [
JqueryAsset::class => false,
YiiAsset::class => false,
ActiveFormAsset::class => false
],
// 'bundles' => false
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question