File tree Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change 2929 "php" : " >=5.5.0" ,
3030 "yiisoft/yii2" : " ~2.0.13" ,
3131 "bower-asset/datatables" : " ~1.10.15" ,
32- "bower-asset/datatables-plugins" : " ~1.10.15"
32+ "bower-asset/datatables-plugins" : " ~1.10.15" ,
33+ "bower-asset/datatables.net-bs4" : " ~1.10.15" ,
34+ "npm-asset/datatables.net-bs5" : " ~1.10.15"
3335 },
3436 "autoload" : {
3537 "psr-4" : {
Original file line number Diff line number Diff line change 1212
1313class DataTableBootstrapAsset extends AssetBundle
1414{
15- public $ sourcePath = '@bower/datatables-plugins/integration/bootstrap/3 ' ;
16-
1715 public $ depends = [
1816 DataTableBaseAsset::class,
1917 ];
@@ -22,9 +20,24 @@ public function init()
2220 {
2321 parent ::init ();
2422
25- $ this ->depends [] = 'yii\bootstrap\BootstrapAsset ' ;
26- $ this ->css [] = 'dataTables.bootstrap.css ' ;
27- $ this ->js [] = 'dataTables.bootstrap ' . (YII_ENV_DEV ? '' : '.min ' ) . '.js ' ;
23+ if (class_exists ('yii\bootstrap\BootstrapAsset ' )) {
24+ $ this ->sourcePath = '@bower/datatables-plugins/integration/bootstrap/3 ' ;
25+ $ this ->depends [] = 'yii\bootstrap\BootstrapAsset ' ;
26+ $ this ->css [] = 'dataTables.bootstrap.css ' ;
27+ $ this ->js [] = 'dataTables.bootstrap ' . (YII_ENV_DEV ? '' : '.min ' ) . '.js ' ;
28+
29+ } else if (class_exists ('yii\bootstrap4\BootstrapAsset ' )) {
30+ $ this ->sourcePath = '@bower/datatables.net-bs4 ' ;
31+ $ this ->depends [] = 'yii\bootstrap4\BootstrapAsset ' ;
32+ $ this ->css [] = 'css\dataTables.bootstrap4.css ' ;
33+ $ this ->js [] = 'js\dataTables.bootstrap4 ' . (YII_ENV_DEV ? '' : '.min ' ) . '.js ' ;
34+
35+ } else {
36+ $ this ->sourcePath = '@npm/datatables.net-bs5 ' ;
37+ $ this ->depends [] = 'yii\bootstrap5\BootstrapAsset ' ;
38+ $ this ->css [] = 'css\dataTables.bootstrap5.css ' ;
39+ $ this ->js [] = 'js\dataTables.bootstrap5 ' . (YII_ENV_DEV ? '' : '.min ' ) . '.js ' ;
40+ }
2841 }
2942
3043}
You can’t perform that action at this time.
0 commit comments