【问题标题】:Add a dropdown box using Laravel + Blade使用 Laravel + Blade 添加下拉框
【发布时间】:2017-03-24 01:20:19
【问题描述】:

如何在我当前的 Blade 代码中添加下拉框?

这是我目前拥有的:

{!! Form::input('text', 'example', old("example", $user->example), array('class' => 'form-control')) !!}

【问题讨论】:

    标签: php laravel blade laravel-blade


    【解决方案1】:

    试试这个:

    echo Form::select('size', array('L' => 'Large', 'S' => 'Small'), 'S', array('id' => 'your_id', 'class' => 'your_class'));
    

    地点:

    size: 下拉列表的名称,

    array: 生成下拉列表的数组,

    S:默认选择值,

    之后,您可以在数组中传递idclassstyle,例如:

    array('id' => 'your_id', 'class' => 'your_class')
    

    【讨论】:

      猜你喜欢
      • 2021-01-26
      • 2020-09-05
      • 2018-03-12
      • 2015-12-24
      • 1970-01-01
      • 1970-01-01
      • 2015-03-28
      • 2021-03-25
      • 1970-01-01
      相关资源
      最近更新 更多