laravel 将图标添加到 Laravelcollective 提交按钮
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41211522/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Add icon to Laravelcollective submit button
提问by Ariando Miller
I'm trying to add a trash icon to submit button and I tried this :
我正在尝试添加一个垃圾桶图标来提交按钮,我试过这个:
{!! Form::submit('', ['class' => 'btn btn-warning btn-sm fa fa-trash']) !!}
but the icon won't show. How to solve this ? thanks in advance!
但图标不会显示。如何解决这个问题?提前致谢!
回答by sam12
Try to use Form::button instead of Form::submit:
尝试使用 Form::button 代替 Form::submit:
{{ Form::button('<i class="fa fa-trash"></i>', ['type' => 'submit', 'class' => 'btn btn-warning btn-sm'] ) }}
回答by C47
You can try too with:
您也可以尝试:
Example to input type button:
输入类型按钮的示例:
{{ FORM::button('<i class="glyphicon glyphicon-trash" aria-hidden="true"></i> Text button',['class'=>'button button-red','type'=>'button','id'=>'id-button']) }}
回答by Bhargav Raviya
there are not possible try it laravel collective form given very competition
鉴于竞争激烈,不可能尝试 Laravel 集体形式
<button class='btn btn-primary' type='submit' value='submit'>
<i class='fa fa-save'> </i> Save