mirror of https://gitee.com/karson/fastadmin.git
parent
e7a5ee807f
commit
a5a17ce761
|
|
@ -512,3 +512,19 @@ EOT;
|
|||
return $icon;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('download')) {
|
||||
/**
|
||||
* 获取\think\response\Download对象实例
|
||||
* @param string $filename 要下载的文件
|
||||
* @param string $name 显示文件名
|
||||
* @param bool $content 是否为内容
|
||||
* @param integer $expire 有效期(秒)
|
||||
* @param bool $openinBrowser 设置是否在浏览器中显示文件
|
||||
* @return \think\response\Download
|
||||
*/
|
||||
function download($filename, $name = '', $content = false, $expire = 360, $openinBrowser = false)
|
||||
{
|
||||
return (new \app\common\library\response\Download($filename))->name($name)->isContent($content)->expire($expire)->openinBrowser($openinBrowser);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue