这是我在Laravel中的表格:
Star
现在我想在这些标签的开头添加此HTML:
{!! Form::open($user_id,['method'=>'PATCH','action'=>['changePasswordController@change',$user_id]]) !!}
<div class="form-group">
{!! Form::label('current_password',"current password:") !!}
{!! Form::input('password', 'current_password', null, ['class' => 'form-control']) !!}
</div>
<div class="form-group">
{!! Form::label('new_password',"new password:") !!}
{!! Form::input('password', 'new_password', null, ['class' => 'form-control']) !!}
</div>
<div class="form-group">
{!! Form::label('re_new_password',"re-new password") !!}
{!! Form::input('password', 're_new_password', null, ['class' => 'form-control']) !!}
</div>
<div class="form-group">
{!! Form::submit('submit', ['class' => 'btn btn-primary form-control']) !!}
</div>
@include('errors.list')
{!! Form::close() !!}
我该怎么做?
答案 0 :(得分:1)
最好的方法是将CSS放入CSS文件并使用类。然后只需在标签后添加HTML:
{!! Form::label('current_password',"current password:") !!}
<span class="red">*</span>
{!! Form::input('password', 'current_password', null, ['class' => 'form-control']) !!}