Пример #1
0
 /**
  * sends out the json response to the browser
  * this will fetch the response from ->get_json() if not given via $response
  * 
  * @note this is the same as jsonapi\response->send_response() ..
  *       .. but it will also terminate script execution afterwards
  * 
  * @param  string $content_type   optional, defaults to ::CONTENT_TYPE_OFFICIAL (the official IANA registered one) ..
  *                                .. or to ::CONTENT_TYPE_DEBUG, @see ::$debug
  * @param  int    $encode_options optional, $options for json_encode()
  *                                defaults to ::ENCODE_DEFAULT or ::ENCODE_DEBUG, @see ::$debug
  * @param  json   $response       optional, defaults to ::get_json()
  * @return void                   more so, a string will be echo'd to the browser ..
  *                                .. and script execution will terminate
  */
 public function send_response($content_type = null, $encode_options = null, $response = null)
 {
     parent::send_response($content_type, $encode_options, $response);
     exit;
 }