Skip to content
This repository has been archived by the owner on Jan 10, 2021. It is now read-only.

Commit

Permalink
Implementing pretty JSON output.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Glasl committed May 25, 2015
1 parent 004373e commit 60b9ccd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion code/controllers/ExtensibleSearchAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ public function getSuggestions($request) {
// Return the search suggestions as JSON.

$this->getResponse()->addHeader('Content-Type', 'application/json');
return Convert::raw2json($suggestions);

// JSON_PRETTY_PRINT.

return json_encode($suggestions, 128);
}
else {
return $this->httpError(404);
Expand Down

0 comments on commit 60b9ccd

Please sign in to comment.