如何将Bootstrap转换为Laravel?
自举
<div class="form-group has-success">
<label class="control-label" for="inputSuccess">Input success</label>
<input type="text" class="form-control" id="inputSuccess">
</div>
Laravel
<div class="form-group" has-success>
{!! Form::label('name','Name:') !!}
{!! Form::text('name', null,['class'=>'form-control','id'=>'inputSuccess','required']) !!}
</div>
<div class="form-group">
{!! Form::label('description','Description:') !!}
{!! Form::text('description', null,['class'=>'form-control','required']) !!}
</div>
<div class="form-group">
{!! Form::label('price','Price:') !!}
{!! Form::text('price', null,['class'=>'form-control','required']) !!}
</div>
{!! Form::submit('Save',['class'=>"btn btn-success"]) !!}
</div>
</div>
</div>
</div>
</div>
答案 0 :(得分:1)
更改
<div class="form-group has-success">
<label class="control-label" for="inputSuccess">Input success</label>
<input type="text" class="form-control" id="inputSuccess">
</div>
到这个
<div class="form-group has-success">
{!! Form::label('inputSuccess', 'Input success', ['class' => 'control-label']) !!}
{!! Form::text('inputSuccess', null, ['class' => 'form-control']) !!}
</div>
Form :: label(1,2)
1 - name to for =“”属性。 2 - 显示该标签的名称。
表格::文字(1,2,3)
1 - 输入名称(name =“”)。 2 - 默认值(可选)。 3 - 输入属性。您可以设置占位符,maxlength,class,id CSS等。
阅读本文以获取有关Laravel Collective的更多信息。
答案 1 :(得分:0)
<div>
<label class="control-label" for="name">First Name</label>
<input type="text" class="form-control" name=first_name>
</div>
<div>
{!! Form::label('name', 'First Name', ['class' => 'form-control']) !!}
{!! Form::text('first_name', null, ['class' => 'form-control']) !!}
</div>
答案 2 :(得分:-1)
参考laravel Forms & Html
adb shell am set-debug-app --persistent com.kushtrim.playground