• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
error when call JSON response

#1
Hello, I don't know this is bug or not. But ...

I have Controller A with method like :

Code:
public function myjson() {
     ....
     ....

     return $this->respond($json); // output JSON    
}

when call : http://localhost:8080/a/myjson
showing the output, JSON

but the problem is, when call by other controller show Error like
"Call to a member function setContentType() on null" ...
   
____
when code changed to

Code:
public function myjson() {
     ....
     ....

     return json_encode($json); // output JSON    
}

no error
Reply


Messages In This Thread
error when call JSON response - by mylastof - 09-10-2020, 10:14 AM
RE: error when call JSON response - by T.O.M. - 09-10-2020, 11:15 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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