Context
I have a Yii2 application in which there is a module for administration.
I would like to use a specific layout for this module thus, in the Admin.php for the module I declare
public $layout = 'main';
and place the specific layout in the wiews/layouts folder of the module
The layout for the application uses
AppAsset::register($this);
and so do the layout for the admin module.
The AppAsset.php is trivial
class AppAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [
'scss/myOwnStyle.scss'
];
public $js = [
];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
];
}
The functionality of Bootstrap I want to use is the tabbed view.
Results
Letting things as described above, the switching between tabs in an admin page doesn't work. Removing the specif layout from admin module, everything works well.
In fact, this is due to the absence of the Bootstrap javascript in the page. Indeed
<script src="/assets/f7ad570a/js/bootstrap.js"></script>
do not appear in the source of the page when using the specific layout.
My question
How comes the bootstrap.js script is not included in the admin pages when using my specific layout ?