$data
$data : mixed
原始数据
Html Response
$data : mixed
原始数据
$contentType : string
输出type
$charset : string
字符集
$code : int
状态码
$allowCache : bool
是否允许请求缓存
$options : array
输出参数
$header : array
header参数
$content : string
输出内容
$cookie : \think\Cookie
Cookie对象
$session : \think\Session
Session对象
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2021 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
declare (strict_types = 1);
namespace think\response;
use think\Cookie;
use think\Response;
/**
* Html Response
*/
class Html extends Response
{
/**
* 输出type
* @var string
*/
protected $contentType = 'text/html';
public function __construct(Cookie $cookie, $data = '', int $code = 200)
{
$this->init($data, $code);
$this->cookie = $cookie;
}
}