【发布时间】:2015-07-23 03:59:28
【问题描述】:
我有一个使用 Lavarel 设计的 CRM 系统。我想要做的是选择一些联系人,点击保存按钮(我必须在导出为 CSV 之前保存)。
但是,当我点击下载按钮后,我的联系人将不会导出到 CSV,并且我收到此错误:
Symfony\Component\Debug\Exception\FatalErrorException (E_ERROR) 调用未定义的方法 Symfony\Component\HttpFoundation\BinaryFileResponse::withCookie() 打开:/home/mirjamro/public_html/mr-admin.com/app/filters.php
Auth::logout(); return Redirect::to(URL::route('AdminShowLogin')); }
if(Auth::check()){
$ckname=Auth::getRecallerName(); //Get the name of the cookie, where remember me expiration time is stored
$ckval=Cookie::get($ckname); //Get the value of the cookie
return $response->withCookie(Cookie::make($ckname,$ckval,1440)); //change the expiration time
}
});
我无法从服务器下载任何东西。
【问题讨论】:
-
您在
BinaryFileResponse中调用了withCookie()函数,但该函数尚未定义。 -
@edi9999 请在编辑问题时使用正确的代码块。
-
提问时,尽量用恰当的语言尊重他人的眼睛和大脑。像第一次阅读一样重新阅读问题一两次,然后说其他人是否清楚地理解您的问题。