Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Klein/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,15 @@ public function file($path, $filename = null, $mimetype = null)
*
* @param mixed $object The data to encode as JSON
* @param string $jsonp_prefix The name of the JSON-P function prefix
* @param int $options JSON encode options
* @return Response
*/
public function json($object, $jsonp_prefix = null)
public function json($object, $jsonp_prefix = null, $options = 0)
{
$this->body('');
$this->noCache();

$json = json_encode($object);
$json = json_encode($object, $options);

if (null !== $jsonp_prefix) {
// Should ideally be application/json-p once adopted
Expand Down