klein / klein.php

A fast & flexible router
MIT License
2.66k stars 290 forks source link

Ability to pass json encoding options. #302

Open mario-deluna opened 9 years ago

mario-deluna commented 9 years ago

Added an optional argument to the Response->json method that allows passing of encoding options like JSON_PRETTY_PRINT.

I hope this is not a duplicate. But i thought it could be handy to be able to pass encoding options to the json response method.

Example:

$response->json($data, null, JSON_PRETTY_PRINT);