public function json($data, $statusCode=null)
    {
        // Set Status Code
        if ($statusCode) {
            $this->setStatusCode($statusCode);
        }
        
        $this->setFormat(Response::FORMAT_JSON);

        if (!is_null($data)) {
            $this->setData($data);
        }
        
        return $this->send();
    }
public function json($data, $statusCode=null)
    {
        // Set Status Code
        if ($statusCode) {
            $this->setStatusCode($statusCode);
        }
        
        $this->setFormat(Response::FORMAT_JSON);

        if (!is_null($data)) {
            $this->setData($data);
        }
        
        return $this->send();
    }
public function json ( $ data , $ statusCode = null ) { // Set Status Code if ( $ statusCode ) { $ this -> setStatusCode ( $ statusCode ) ; } $ this -> setFormat ( Response :: FORMAT_JSON ) ; if ( ! is_null ( $ data ) ) { $ this -> setData ( $ data ) ; } return $ this -> send ( ) ; }
JSON output shortcut

@param array|mixed Callback data body, false will remove body key
@param int Callback status code
@return string Response body data
JSON output shortcut