Created
August 5, 2015 11:55
-
-
Save markguinn/d6ce3c33eacacef534bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param array $data | |
* @return SS_HTTPResponse | |
*/ | |
protected function returnJson(array $data) { | |
$response = $this->getController()->getResponse(); | |
$response->addHeader('Content-type', 'application/json'); | |
$response->setBody(json_encode($data)); | |
return $response; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment