Skip to content

Commit dd85b17

Browse files
committed
Add method to get dataTable options array.
1 parent 1a32419 commit dd85b17

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/Html/Builder.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,17 @@ public function generateScripts()
118118
*/
119119
public function generateJson()
120120
{
121-
$args = array_merge(
121+
return $this->parameterize($this->getOptions());
122+
}
123+
124+
/**
125+
* Get DataTable options array.
126+
*
127+
* @return array
128+
*/
129+
public function getOptions()
130+
{
131+
return array_merge(
122132
$this->attributes, [
123133
'ajax' => $this->ajax,
124134
'columns' => $this->collection->map(function (Column $column) {
@@ -129,8 +139,6 @@ public function generateJson()
129139
})->toArray(),
130140
]
131141
);
132-
133-
return $this->parameterize($args);
134142
}
135143

136144
/**

0 commit comments

Comments
 (0)