Welcome Guest, Not a member yet? Register   Sign In
return an unescaped json
#1

Hi, i have some strings like 
Quote:["000"]
and with the classic $this->respond($mydata, 200) i can't unescape this. the json output is always "[\"000\"]"
I've also try
PHP Code:
    return $this->response->setStatusCode(200)
    ->setHeader('Content-Type''application/json')
    ->setBody(json_encode($mydataJSON_UNESCAPED_SLASHES)); 
but the result is the same.

Any suggestion?
Thanks in advance
Reply
#2

Hi, check your app\Config\Format, that's where you find the formatter for the built in json encoder. And tweak it there.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB