我试图从单选按钮的onlick函数中的刀片文件中调用控制器函数(以及传递一些变量)。但是,我似乎还无法从刀片文件中的控制器调用该函数(单击选择时什么也没有发生)
我的刀片文件
<div class="container box">
@foreach($questionList as $post)
<div class = "test">
<p>
<strong>{{$post->getQuestionId()}}. {{$post->getQuestion()}}</strong>
<br>
</p>
<span>
<input type="radio" name="{{$post->getQuestionId()}}" href="{{action('questionController@updateChoice',$data->$post->getQuestionId())}}" value="a">
<label for="a">{{$post->getChoiceA()}}</label>
</span>
<span>
<input type="radio" name="{{$post->getQuestionId()}}" value="b"> <label for="b">{{$post->getChoiceB()}}</label></span>
<span>
<input type="radio" name="{{$post->getQuestionId()}}" value="c">
<label for="c">{{$post->getChoiceC()}}</label>
</span>
<span>
<input type="radio" name="{{$post->getQuestionId()}}" value="d">
<label for="d">{{$post->getChoiceD()}}</label>
</span>
<br>
</div>
@endforeach
</div>
我的questionController方法
function updateChoice($id)
{
/// do function in here
}
我还需要做其他事情吗?