本文整理汇总了PHP中response::send_response方法的典型用法代码示例。如果您正苦于以下问题:PHP response::send_response方法的具体用法?PHP response::send_response怎么用?PHP response::send_response使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类response
的用法示例。
在下文中一共展示了response::send_response方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send_response
/**
* 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;
}