How do I pass in an HTML5 attributes like: required, auto focus...?
I can enter other attributes which have name="value", but not an attribute that consist of only one word.
How do I pass in an HTML5 attributes like: required, auto focus...?
I can enter other attributes which have name="value", but not an attribute that consist of only one word.
将数组作为第三个(select
作为第四个)参数传递:
{!! Form:: text('name', null, ['required' => true, 'some-param' => 'itsValue', 'class' => 'some-class' ]) !!}
这里有些例子:
{!! Form::label('title', 'Title') !!}
{!! Form::text('title', null, ['class' => 'form-control', 'placeholder' => 'Interview']) !!}
{!! Form::textarea('description', null, [ 'size' => '1x3', 'class' => 'form-control', 'placeholder' => 'Something']) !!}
{!! Form::select('timeOption', [null => 'Please Select', '1' => 'N/A', '2' => 'Instructor', '3' => 'Student'], null, ['required' => true]) !!}
{!! Form::date('task_date', Carbon\Carbon::now(), ['class' => 'form-control']) !!}
{!! Form::time('task_time', Carbon\Carbon::now()->format('H:i'), ['class' => 'form-control']) !!}
{!! Form::number('lat', null, ['class' => 'form-control', 'step' => 'any', 'placeholder' => '41.3770401']) !!}
{!! Form::submit('Add', ['class' => 'btn btn-success']) !!}