我正在使用laravel 5.1中的HtmlServiceProvider
来构建我的表单,当我从模型类中获取数据时,我想在select下拉列表标记中设置所选选项
到目前为止我的代码:
{!! Form::model($advertisment,['url'=>'dashboard/edit/advertisment']) !!}
{!! Form::select('Gender', [""=>'Select Gender',"Male"=>'Male', "Female"=>'Female'],0, ['class' => 'form-control', 'id' => 'form_control_6' ,'required']) !!}
{!! Form::close() !!}
答案 0 :(得分:2)
将0参数设置为" Male"例如,你会搞清楚
答案 1 :(得分:0)
如果您不想覆盖模型中的值,请传入NeededColumns = DataFrame({
'LABLE': ['ABC_123', 'ABC_123', 'ABC_123', 'ABC_123', 'ABC_123'],
'RAW_ID_3': [2, 71, 376, 526, 651],
'RAW_SCRIBE': ['K9FDB002WFD7',
'X4PH8071KOE4',
'AZ0GR376JKH2',
'BA5QF526JKG2',
'AY7WC651JKA1'],
'SPC_LOT': ['D1111111', 'D2222222', 'D3333333', 'D4444444', 'D5555555'],
'SPC_LOT7_x': ['D111111', 'D222222', 'D333333', 'D444444', 'D555555'],
'SPC_OPERATION': ['115', '115', '115', '115', '115'],
'SPC_PRODUCT': ['ABC', 'ABC', 'ABC', 'ABC', 'ABC'],
'SPC_RAW_VALUE': [0.22, 0.552, 0.535, 0.457, 0.35100000000000003],
'SPC_TXN_DATE_x': ['2015-09-13 08:22:26',
'2015-09-13 08:30:26',
'2015-09-13 10:10:37',
'2015-09-13 22:30:17',
'2015-09-13 23:18:32']})