Archived
1
0
Fork 0

app/models/Data/RequestMeta.php: in getBody() prettyprint some json :)

This commit is contained in:
Henrik Hautakoski 2018-04-19 13:45:47 +02:00
parent ccc8ae033a
commit 2efebfbfef

View file

@ -3,6 +3,7 @@
namespace App\Model\Data;
use Phalcon\Mvc\Model;
use Localheinz\Json\Printer\Printer as JsonPrinter;
class RequestMeta extends Model
{
@ -239,7 +240,13 @@ class RequestMeta extends Model
public function getBody()
{
return $this->getRequestObject()->getBody();
$body = $this->getRequestObject()->getBody();
if ($this->getType() == 'json') {
$printer = new JsonPrinter();
return $printer->print($body, ' ');
}
return $body;
}
/**