这是laravel 集体形式,这是一个下拉字段,它与数据库连接。我怎样才能转换普通的html表格???
{!! Form::open(['method'=>'POST', 'action'=> xyz\AddController@store', 'id'=> 'form']) !!}
<div class="form-group col-sm-5">
{!! Form::label('student_id', 'Students:') !!}
{!! Form::select('student_id', [''=>'Choose Options'] + $students , null, ['class'=>'form-control', 'id'=>'student', 'name'=>'student_id'])!!}
</div>
{!! Form::close() !!}
我想转换这样的格式
<div class="form-group col-lg-5">
<label for="qty">Traded Quantity</label>
<input type="text" name="qty" id="qty" class="form-control" />
</div>
答案 0 :(得分:0)
如果学生列表来自数据库,那么select tag可以是这样的,
<select id="student" class="form_control" name="student_id">
<option>Choose Options</option>
@foreach($students as $student)
<option value="{{$student->id}}">{{$student->id}}</option>
@endforeach
</select>