2015-04-16 43 views
0

我想插入輸入::老跟我的單選按鈕Laravel:輸入舊的單選按鈕

<td>{{ Form::radio('student['.$user->student_id.'][status]', 'present', (Input::old('student') == 'present')) }}</td> 
<td>{{ Form::radio('student['.$user->student_id.'][status]', 'late', (Input::old('student') == 'late')) }}</td> 
<td>{{ Form::radio('student['.$user->student_id.'][status]', 'absent', (Input::old('student') == 'absent')) }}</td> 
<td>{{ Form::radio('student['.$user->student_id.'][status]', 'others', (Input::old('student') == 'others')) }}</td> 

我嘗試這樣做,它不工作:(請幫助

+0

你是什麼意思它不工作?我想輸入::老(「學生」)將包含學生ID數組,所以我不認爲你可以使用這種方式。 – Needpoule

+0

對不起...有沒有其他的如何做這個方法? –

+0

不確定,但你可以嘗試Input :: old('student。'。$ user-> student_id。'status') – Needpoule

回答

1

嘗試這樣

{{ Form::radio('student', 'present', (Input::old('student') == 'present'), array('id'=>'present', 'class'=>'radio')) }}