Skip to content

Commit 739bacf

Browse files
authored
Update SummernoteAsset.php
Support for Bootstrap 5.
1 parent a7038f5 commit 739bacf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

SummernoteAsset.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ public function init()
2121
{
2222
$postfix = YII_DEBUG ? '' : '.min';
2323

24-
if (isset(Yii::$app->params['bsVersion']) && Yii::$app->params['bsVersion'] == 4) {
24+
if (isset(Yii::$app->params['bsVersion']) && substr(Yii::$app->params['bsVersion'], 0, 1) == '5') {
25+
$this->depends = ['yii\bootstrap5\BootstrapPluginAsset'];
26+
$this->css[] = 'summernote-bs5' . $postfix . '.css';
27+
$this->js[] = 'summernote-bs5' . $postfix . '.js';
28+
} elseif (isset(Yii::$app->params['bsVersion']) && substr(Yii::$app->params['bsVersion'], 0, 1) == '4') {
2529
$this->depends = ['yii\bootstrap4\BootstrapPluginAsset'];
26-
$this->css[] = 'summernote-bs4.css';
30+
$this->css[] = 'summernote-bs4' . $postfix . '.css';
2731
$this->js[] = 'summernote-bs4' . $postfix . '.js';
2832
} else {
2933
$this->depends = ['yii\bootstrap\BootstrapPluginAsset'];

0 commit comments

Comments
 (0)