尝试将路由回验证检查错误的页面。这不起作用,这是做什么的正确方法?Laravel重定向回通配符值
$route = "staff/" . $staff->staff_id;
return Redirect::to_route($route)
->with_errors($validation);
尝试将路由回验证检查错误的页面。这不起作用,这是做什么的正确方法?Laravel重定向回通配符值
$route = "staff/" . $staff->staff_id;
return Redirect::to_route($route)
->with_errors($validation);
你可以试试这个重定向回(假设Laravel 3)
return Redirect::back()->with_errors($validation);
或这一个
return Redirect::back()->with_errors($validation)->with_input();
所以,没有必要提及的路线,这是一个测试我的项目。
? (与问题无关,只是想在此问) – itachi
@itachi,不,您将在视图中使用'Input :: old('field_name')''。 –
很不错,它是'Redirect :: back() - > withErrors($ validation) - > withInput()'用于Laravel 4 –
把它作为数组我的错误: 回报重定向:: to_route( '员工',阵列($ staff-> staff_id)) \t \t \t \t \t - > with_errors($验证);在使用' - > with_input()'时需要'Input :: flash()'是否需要 –