Skip to content

Instantly share code, notes, and snippets.

@lisotton
Last active October 29, 2023 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lisotton/8209d9a019d8fa7686baad87c3d1cc65 to your computer and use it in GitHub Desktop.
Save lisotton/8209d9a019d8fa7686baad87c3d1cc65 to your computer and use it in GitHub Desktop.
Yii2 Debug bar using external assets
--- src/Module.php
+++ src/Module.php
@@ -354,7 +354,25 @@
*/
protected function resetGlobalSettings()
{
- Yii::$app->assetManager->bundles = [];
+ Yii::$app->assetManager->bundles = [
+ 'yii\web\JqueryAsset' => [
+ 'js' => ['https://cdn.jsdelivr.net/npm/jquery@2.2.4/dist/jquery.min.js'],
+ 'jsOptions' => ['type' => 'text/javascript'],
+ 'sourcePath' => NULL,
+ ],
+ 'yii\bootstrap\BootstrapAsset' => [
+ 'sourcePath' => NULL,
+ 'css' => ['https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/css/bootstrap.min.css'],
+ ],
+ 'yii\bootstrap\BootstrapPluginAsset' => [
+ 'js' => ['https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/js/bootstrap.min.js'],
+ 'sourcePath' => NULL,
+ ],
+ 'yii\widgets\PjaxAsset' => [
+ 'js' => ['https://cdn.jsdelivr.net/gh/yiisoft/jquery-pjax@master/jquery.pjax.js'],
+ 'sourcePath' => NULL,
+ ],
+ ];
}
/**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment