当以下路由时控制器返回无效:
Route::post('/new/save', 'RoomsController@save');
if ($validator->fails()) {
return Redirect::back()->withInput()->withErrors($validator- >messages());
}
无法返回。
单独在路由中进行语句效果测试:
Route::post('/new/save', function(){
return Redirect::back()->withInput();
});
有效,立即返回了。
简而言之:就是在Controller中使用return Redirect::back() 没有任何反应,采用echo Redirect::back()的话,会显示一些多余的信息(即header输出),然后才跳转:
HTTP/1.0 302 Found Cache-Control: no-cache Date: Fri, 08 Aug 2014 18:49:35 GMT Location: http://*******/new/sell Redirecting to http://******/new/sell.
Why~~?