Skip to content

Commit

Permalink
Update SummernoteAsset.php
Browse files Browse the repository at this point in the history
Support for Bootstrap 5.
  • Loading branch information
marqu3s authored Jul 24, 2024
1 parent a7038f5 commit 739bacf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions SummernoteAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ public function init()
{
$postfix = YII_DEBUG ? '' : '.min';

if (isset(Yii::$app->params['bsVersion']) && Yii::$app->params['bsVersion'] == 4) {
if (isset(Yii::$app->params['bsVersion']) && substr(Yii::$app->params['bsVersion'], 0, 1) == '5') {
$this->depends = ['yii\bootstrap5\BootstrapPluginAsset'];
$this->css[] = 'summernote-bs5' . $postfix . '.css';
$this->js[] = 'summernote-bs5' . $postfix . '.js';
} elseif (isset(Yii::$app->params['bsVersion']) && substr(Yii::$app->params['bsVersion'], 0, 1) == '4') {
$this->depends = ['yii\bootstrap4\BootstrapPluginAsset'];
$this->css[] = 'summernote-bs4.css';
$this->css[] = 'summernote-bs4' . $postfix . '.css';
$this->js[] = 'summernote-bs4' . $postfix . '.js';
} else {
$this->depends = ['yii\bootstrap\BootstrapPluginAsset'];
Expand Down

0 comments on commit 739bacf

Please sign in to comment.