响应::因为laravel中的标题而下载错误

时间:2016-01-19 07:45:28

标签: php laravel-4

控制器:

public function download(){

 $headers = array('Content-Type' => 'text/csv');
 return Response::download('download.csv', 'download.csv', $headers)->setContentDisposition('inline');

}

过滤器:

 $response->header('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0');

错误:

 [2016-01-19 15:34:29] local.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Call to undefined method Symfony\Component\HttpFoundation\BinaryFileResponse::header()' in C:\xampp\htdocs\development\app\filters.php:60
  Stack trace:
  #0 [internal function]: Illuminate\Exception\Handler->handleShutdown()
  #1 {main} [] []

我不知道如何解决这类问题。我已经尝试了this但仍然没有工作。

0 个答案:

没有答案