【问题标题】:Laravel Collective Form and Custom Bootstrap componentLaravel 集体表单和自定义 Bootstrap 组件
【发布时间】:2017-10-23 17:11:54
【问题描述】:

我的视图中有这个提交按钮,使用 Laravel Collective 包:

{!! Form::submit('Delete', ['class' => 'btn btn-danger']) !!}

如您所见,它添加了一个 Bootstrap 类并创建了一个按钮。

现在我的目的是创建一个这样的自定义按钮:

<button type="button" class="btn btn-default btn-lg">
    <span class="glyphicon glyphicon-star" aria-hidden="true"></span> Star
</button>

有一个跨度来保留字形。我怎么能这样做?

【问题讨论】:

    标签: php twitter-bootstrap laravel laravelcollective


    【解决方案1】:

    您需要创建一个自定义宏来实现这一点。

    https://laravelcollective.com/docs/master/html#custom-macros

    除非您打算大量重复使用它,否则最好创建一个部分。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-01-03
      • 1970-01-01
      • 1970-01-01
      • 2020-11-19
      • 2018-10-02
      • 1970-01-01
      • 2021-01-05
      相关资源
      最近更新 更多