Skip to content

Commit a39da1d

Browse files
authored
Merge pull request yajra#54 from lk77/3.0
[3.0] Moving callback condition to config.
2 parents 5fa3b4f + 8bb2852 commit a39da1d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/Html/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function parameterize($attributes = [])
161161
*/
162162
protected function isCallbackFunction($value, $key)
163163
{
164-
return Str::startsWith(trim($value), ['$', '$.', 'function']) || Str::contains($key, 'editor');
164+
return Str::startsWith(trim($value), $this->config->get('datatables-html.callback', ['$', '$.', 'function'])) || Str::contains($key, 'editor');
165165
}
166166

167167
/**

src/resources/config/config.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,9 @@
88
'class' => 'table',
99
'id' => 'dataTableBuilder',
1010
],
11+
/*
12+
* Default condition to determine if a parameter is a callback or not
13+
* Callbacks needs to start by those terms or they will be casted to string
14+
*/
15+
'callback' => ['$', '$.', 'function'],
1116
];

0 commit comments

Comments
 (0)