本文整理匯總了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;
}