shanezhiu
(shane)
1
I initialled a project from Yii2 advanced template, and read Assets.
Then I edited backend\assets\AppAsset with commenting the code
public $depends = [ 'yii\web\YiiAsset', 'yii\bootstrap\BootstrapAsset', ];
It expect the page do not load yii.js and bootstrap.css assets according the doc describing.
Howerver, it did, why?
jacmoe
(Jacob Moena)
2
It will do this whenever yii.js and bootstrap.css is needed, i.e. when you use a form or a Bootstrap widget.
In order to turn them off, you will need to configure the AssetManager (in web.php) like this:
'assetManager' => [
...
'bundles' => [
'yii\bootstrap\BootstrapAsset' => false,
'yii\web\YiiAsset' => false,
]
],
shanezhiu
(shane)
3
But what is the depend property purpose?
jacmoe
(Jacob Moena)
4
To make sure that whenever that asset is loaded, the other assets are loaded before it. 
shanezhiu
(shane)
5
It is a little bit ambiguity.
1 Like
jacmoe
(Jacob Moena)
6
Well, it ‘depends’ (sorry about the pun).
If you read it like this, it will make sense:
“The asset (the one you’re looking at) depends on the following other assets”.