@@ -75,7 +75,7 @@ private function setTableOptions(): array
75
75
$ settings ['data-locale ' ] = Yii::$ app ->language ;
76
76
}
77
77
78
- return $ this ->tableOptions = array_merge ($ this ->tableOptions , $ settings );
78
+ return $ this ->tableOptions = array_merge ($ settings , $ this ->tableOptions );
79
79
}
80
80
81
81
public function run (): string
@@ -88,7 +88,6 @@ public function run(): string
88
88
public function renderTableHeader (): string
89
89
{
90
90
$ html = [];
91
-
92
91
if ($ this ->rowCheckboxSelect ) {
93
92
$ html [] = $ this ->addColumnCheckboxSelect ();
94
93
}
@@ -133,22 +132,17 @@ private function renderTableHeaderCell($cell): string
133
132
private function setHeaderOptions ($ column )
134
133
{
135
134
$ columnClass = (new ReflectionClass ($ column ))->getShortName ();
136
- switch ($ columnClass ) {
137
- case 'ActionColumn ' :
138
- $ column ->headerOptions = [
139
- 'data-field ' => 'action ' ,
140
- 'data-filter-control ' => 'false ' ,
141
- 'data-searchable ' => 'false ' ,
142
- 'data-sortable ' => 'false ' ,
143
- 'data-switchable ' => 'false ' ,
144
- ];
145
- break ;
135
+ if ('ActionColumn ' === $ columnClass ) {
136
+ $ column ->headerOptions = [
137
+ 'data-field ' => 'action ' ,
138
+ 'data-filter-control ' => 'false ' ,
139
+ 'data-searchable ' => 'false ' ,
140
+ 'data-sortable ' => 'false ' ,
141
+ 'data-switchable ' => 'false ' ,
142
+ ];
146
143
}
147
144
148
- $ column ->headerOptions = array_merge (
149
- self ::$ defaultHeaderOptions ,
150
- $ column ->headerOptions
151
- );
145
+ $ column ->headerOptions = array_merge (self ::$ defaultHeaderOptions , $ column ->headerOptions );
152
146
153
147
return $ column ;
154
148
}
0 commit comments