• 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.