添加类以选择Laravel上的元素 [英] Add Class to select element on Laravel

查看:51
本文介绍了添加类以选择Laravel上的元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了这个问题,我找不到在此下拉列表框中添加类属性的方法

I have this problem, I can't find the way to add class attribute in this Dropdown box

{{Form::select('bancada', Bancada::lists('nombre','idBancada'))}}

我尝试了各种语法,但无法使其正常工作.

I have tried various syntax, but can not get it to work.

有什么建议吗?谢谢

推荐答案

使用第四参数向您的元素添加属性.

Use the forth parameter to add attributes to your element.

{{Form::select('bancada', Bancada::lists('nombre','idBancada'), null, ['class' => 'my_class'])}}

看看($options与属性相同为您的元素).

Take a look at the source ($options is the same as attributes for your element).

这篇关于添加类以选择Laravel上的元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆