__construct() __construct(mixed $data = '', int $code = 200, array $header = [], array $options = []) : mixed 架构函数 Parameters mixed $data 输出数据 int $code array $header array $options 输出参数 Returns mixed —
create() create(mixed $data = '', string $type = '', int $code = 200, array $header = [], array $options = []) : \think\Response 创建Response对象 Parameters mixed $data 输出数据 string $type 输出类型 int $code array $header array $options 输出参数 Returns \think\Response —
header() header(string|array $name, string $value = null) : $this 设置响应头 Parameters string|array $name 参数名 string $value 参数值 Returns $this —
lastModified() lastModified(string $time) : $this LastModified Parameters string $time Returns $this —
cacheControl() cacheControl(string $cache) : $this 页面缓存控制 Parameters string $cache 缓存设置 Returns $this —
contentType() contentType(string $contentType, string $charset = 'utf-8') : $this 页面输出类型 Parameters string $contentType 输出类型 string $charset 输出编码 Returns $this —
isContent() isContent(bool $content = true) : $this 设置是否为内容 必须配合mimeType方法使用 Parameters bool $content Returns $this —
name() name(string $filename, bool $extension = true) : $this 设置下载文件的显示名称 Parameters string $filename 文件名 bool $extension 后缀自动识别 Returns $this —
openinBrowser() openinBrowser(bool $openinBrowser) : $this 设置是否在浏览器中显示文件 Parameters bool $openinBrowser 是否在浏览器中显示文件 Returns $this —
output() output(mixed $data) : mixed 处理数据 Parameters mixed $data 要处理的数据 Throws \Exception Returns mixed —
getMimeType() getMimeType(string $filename) : string 获取文件类型信息 Parameters string $filename 文件名 Returns string —