Skip to content

Commit 115d537

Browse files
committed
Fix possible error when rendering table and overriding the attributes.
Merge DT parameters.
1 parent dbc157c commit 115d537

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/yajra/Datatables/Html/Builder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ public function ajax($attributes)
275275
*/
276276
public function table(array $attributes = [])
277277
{
278-
$this->tableAttributes = $attributes ?: $this->tableAttributes;
278+
$this->tableAttributes = array_merge($this->tableAttributes, $attributes);
279279

280280
return '<table ' . $this->html->attributes($this->tableAttributes) . '></table>';
281281
}
@@ -288,7 +288,7 @@ public function table(array $attributes = [])
288288
*/
289289
public function parameters(array $attributes = [])
290290
{
291-
$this->attributes = $attributes;
291+
$this->attributes = array_merge($this->attributes, $attributes);
292292

293293
return $this;
294294
}

0 commit comments

Comments
 (0)