【发布时间】:2014-01-12 07:40:01
【问题描述】:
我在 {{ Form::open() }} 中的操作有问题
路由 [adm/tagedit] 未定义。
我的代码是
{{ Form::open(['method'=>'post','action'=>"adm/tagedit"])}}
{{ Form::submit('edit',['class'=>'btn btn-default']) }}
{{ Form::close() }}
在路线中
Route::get('adm/{action?}/{params?}',function($action,$params=null){
if(Auth::check()==false||Auth::user()->isAdmin()==false){
return \Illuminate\Support\Facades\Redirect::to('/')->withError('Youe need be logged in');
}
return (new AdmController())->{$action}($params);
});
//routing for bacend post method
Route::post('adm/{action?}/{params?}',['before'=>'csrf',function($action,$params=null){
if(Auth::check()==false||Auth::user()->isAdmin()==false){
return \Illuminate\Support\Facades\Redirect::to('/')->withError('You need be logged in');
}
return (new AdmController())->{$action.'Post'}($params);
}]);
当然,如果我使用获取请求操作工作。在控制器中,我使用动作“tageditPost”
可能我的问题与 Rediredt 类似:route() 也不起作用。但是在重定向中,我使用 Reditect:to() 并且工作正常。在形式上,我不知道我应该改变什么。
提前感谢您的回答。
问候
【问题讨论】: