Laravel Collective Form和Custom Bootstrap组件

时间:2017-05-23 16:13:32

标签: php twitter-bootstrap laravel laravelcollective

我在视图中使用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>

具有保持glyphicon的跨度。我怎么能这样做?

1 个答案:

答案 0 :(得分:1)

您需要创建一个自定义宏来实现此目的。

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

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