Skip to content

Commit

Permalink
调整download助手函数参数
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Aug 2, 2018
1 parent 254ca5b commit 4a0a636
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,13 @@ function debug($start, $end = '', $dec = 6)
* 获取\think\response\Download对象实例
* @param string $filename 要下载的文件
* @param string $name 显示文件名
* @param integer $expire 有效期
* @param bool $content 是否为内容
* @param integer $expire 有效期(秒)
* @return \think\response\Download
*/
function download($filename, $name = '', $expire = 360)
function download($filename, $name = '', $content = false, $expire = 180)
{
return Response::create($filename, 'download')->name($name)->expire($expire);
return Response::create($filename, 'download')->name($name)->isContent($content)->expire($expire);
}
}

Expand Down

0 comments on commit 4a0a636

Please sign in to comment.