Welcome Guest, Not a member yet? Register   Sign In
Debug is breaking my JSON... How to disable it from some methods ?
#9

For others looking for solution, just define MIME/"Content-Type" for proper response with all content types if similar functions to "setJSON" doesn't exist.

CodeIgniter automatically disables debug bar in dev when you need to output something other than HTML.

PHP Code:
public function MyResponse(){

    
$this->response->setContentType('Content-Type: application/json');

    
// $my_json = ...

    
echo $my_json;


Reply


Messages In This Thread
RE: Debug is breaking my JSON... How to disable it from some methods ? - by cyberstunts - 04-13-2020, 03:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB