0
如何在我當前的Blade代碼上添加下拉框?使用Laravel + Blade添加下拉框
這是我目前有:
{!! Form::input('text', 'example', old("example", $user->example), array('class' => 'form-control')) !!}
如何在我當前的Blade代碼上添加下拉框?使用Laravel + Blade添加下拉框
這是我目前有:
{!! Form::input('text', 'example', old("example", $user->example), array('class' => 'form-control')) !!}
試試這個:
echo Form::select('size', array('L' => 'Large', 'S' => 'Small'), 'S', array('id' => 'your_id', 'class' => 'your_class'));
其中:
size
:下拉列表的名稱,
array
:陣列產生下拉,
S
:默認選擇的值,
之後,你可以通過id
,class
,style
像的數組:
array('id' => 'your_id', 'class' => 'your_class')