我想在请求完成后下载文件我正在使用这种方法 public function sendFile($id) {
$this->response->file($id, array('download' => true, 'name' => 'PostNet'));
//Return reponse object to prevent controller from trying to render a view
return $this->response;
}
但是我收到一个错误,例如 Call to undefined method CakeResponse::file() 。我应该包含任何类或 CakeResponse 还是已经包含在内?谢谢