Sory因为英语不好。
{{ Form::open(array('action' => array('TaskController@stateChange', $task->id, Auth::id(), 2, 3, 4), 'method' => 'POST', 'role' => 'form')) }}
<button class="btn btn-primary"><span class="glyphicon glyphicon-random"></span> Сдать задачу</button>
{{ Form::close() }}
如果我尝试使用此代码,REQUEST_URI有此viev
/任务/ stateChange / 2/1/2/3→4
之后:
缺少TaskController :: stateChange()
的参数5
功能:
public function stateChange($taskId, $userId, $stateId, $roleId, $statusId)
我必须做什么?
答案 0 :(得分:0)
您应该在routes.php
文件中添加5个参数
例如:
Route::('stateChange/{one}/{two}/{three}/{four}/{five}', ['as' => 'YourController@yourMethod']);
如果您需要可选参数,则需要在括号中添加?
。
Route::('stateChange/{one}/{two}/{three}/{four}/{five}/{six?}', ['as' => 'YourController@yourMethod']);
你的方法看起来像:
yourMethod($one, $two, $three, $four, $five, $six = null)