how to apply css class to laravel collective select

白昼怎懂夜的黑 提交于 2021-02-07 06:23:05

问题


i used laravel 5.3 for my project, i used laravel form collective into it code is below

{{ Form::select('size', ['surat' => 'surat', 'mumbai' => 'mumbai','hongkong' => 'hongkong'], 'hongkong',['multiple'=>'true'], array('class'=> 'form-control') ) }}

but the array('class'=> 'form-control') is not working for me if i removed ['multiple'=>'true'] then it work properly so how can i apply bootstrap class to my select box.


回答1:


The correct syntax:

{!! Form::select('size', $citiesArray, 'hongkong', ['multiple' => 'true', 'class' => 'form-control']) !!}

You should pass id, class and other attributes in an array as 4th parameter.



来源:https://stackoverflow.com/questions/41358271/how-to-apply-css-class-to-laravel-collective-select

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!