figured / bs-forms
Bootstrap V4 风格的表单字段宏,适用于 LaravelCollective/html
此包的官方仓库似乎已不存在,因此该包已被冻结。
0.2.0
2017-07-27 00:29 UTC
Requires
- php: >=5.5.9
- illuminate/support: ~5.2
- laravelcollective/html: ~5.2
This package is not auto-updated.
Last update: 2022-07-09 07:08:50 UTC
README
为 LaravelCollective/html 表单提供自定义宏,用于格式化 Bootstrap V4 字段
安装
首先,通过 Composer 安装此包。编辑您的项目 composer.json 文件,以要求 figured/bs-forms。
"require": { "figured/bs-forms": "dev-master" }
接下来,从终端更新 Composer
composer update
接下来,将新提供者添加到 config/app.php 的 providers 数组中
'providers' => [ // ... Figured\BsForms\BsFormsServiceProvider::class, // ... ],
使用方法
在表单中使用新的字段宏
{!! Form::open(array('url' => 'foo/bar')) !!}
{!! Form::bsText('name') !!}
{!! Form::bsEmail('email') !!}
{!! Form::bsPassword('password') !!}
{!! Form::close() !!}
属性
使用第二个参数向字段添加属性
{!! Form::bsText('name', [
'placeholder' => "Name",
'label' => "Your Name"
'help' => "Enter your name"
]) !!}