Skip to content

Commit

Permalink
Whether to use json format to judge.
Browse files Browse the repository at this point in the history
  • Loading branch information
monkenWu authored Apr 17, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 75e2c33 commit 9382d23
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/TablesIgniter.php
Original file line number Diff line number Diff line change
@@ -176,7 +176,7 @@ private function extraConfig($bui){
/**
* 取得完整的Datatable Json字串
*/
public function getDatatable(){
public function getDatatable($isJson=true){
if($result = $this->getQuery()){
$data = array();
foreach ($result->getResult('array') as $row){
@@ -188,9 +188,9 @@ public function getDatatable(){
"recordsFiltered" => $this->getFiltered(),
"data" => $data
);
return json_encode($output);
return $isJson ? json_encode($output) : $output;
}
return $data;
}

}
}

0 comments on commit 9382d23

Please sign in to comment.