Where Does This Script Come From?


<script type="text/javascript" src="/test/assets/a4c4d848/jquery.js"></script>

<script type="text/javascript" src="/test/assets/d903336f/bootstrap/js/bootstrap.min.js"></script>

<script type="text/javascript" src="/test/assets/d903336f/js/bootstrap-noconflict.js"></script>

<script type="text/javascript" src="/test/assets/d903336f/bootbox/bootbox.min.js"></script>

<script type="text/javascript" src="/test/assets/d903336f/notify/notify.min.js"></script>

<script type="text/javascript" src="/test/assets/d903336f/js/jquery-ui-no-conflict.min.js"></script>

<script type="text/javascript" src="/test/assets/2cc42460/jquery.iframe-transport.js"></script>

<script type="text/javascript" src="/test/assets/2cc42460/jquery.galleryManager.js"></script>

I am just wondering because I need to actually register the bootstrap javascript below , but I am not sure which line generates the code above?


  <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

    <!-- Include all compiled plugins (below), or include individual files as needed -->

    <script src="js/bootstrap.min.js"></script>

  </body>

Sachy,

The Yii2 doc pages seemed to be broken, so I can’t give you any links, but from what I recall:

In the layout for your view is likely a line that reads like this: AppAsset::register( $this );

That’s registering your assets. You could write your own asset package, which is probably a good idea, but in the short run, there are some ways to override the jquery ‘slot’ in the assets, and probably the bootstrap, but I can’t remember them exactly right now. However, you have access to the registered bundles in the view, through the asset manager, that is registering the assets.

Here’s the view class:

http://www.yiiframework.com/doc-2.0/yii-web-view.html#getAssetManager()-detail

The asset manager class:

http://www.yiiframework.com/doc-2.0/yii-web-assetmanager.html#$bundles-detail

FrankW, you can link to github docs.

Thank you, I didn’t even think of that!