Created
February 13, 2015 20:00
-
-
Save cameri/4cb4b52a75b9f86b87c0 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
protected function setResponse($code, $response = null, $headers = null) { | |
if (!is_array($response)) { | |
throw new InvalidArgumentException('Second argument only accepts arrays.'); | |
} | |
$keys = array_keys($response); | |
$this->_keys = array_merge($this->_keys, $keys); | |
$this->set($response); | |
$this->set('_serialize', $this->_keys); | |
$this->response->statusCode($code); | |
if (is_array($headers)) { | |
$this->response->header($this->flatten($headers)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment