Laravel 4 blade drop-down list class attribute

前端 未结 2 1731
轮回少年
轮回少年 2020-12-28 13:35

Laravel blade drop down list class attribute not working.

I cannot find any reference to class or assigning attributes to select / drop-down lists in the documentat

相关标签:
2条回答
  • 2020-12-28 13:55
    {{ Form::select('product_id', $productList, null, array('class' => 'form-control')) }}
    

    The third parameter is the key of the currently selected option. Defaults to null.

    0 讨论(0)
  • 2020-12-28 14:15

    First get and create list in Controller for example:

    $username_lists  = Users::lists('username','id');
    

    pass data to view by:

     return View::make('layouts.customers')
                ->with('username_lists', $username_lists);
    

    now get in view:

    {{ Form::select('username_lists', $username_lists, null, array('class' => 'form-control')) }}
    
    0 讨论(0)
提交回复
热议问题