我尝试使用以下代码构建简单的登录表单:
{!! Form::open(['class'=>'login-form', 'method'=>'post', 'action'=>'AdminUserController@store']) !!}
<h3 class="form-title">Sign In</h3>
<div class="alert alert-danger display-hide">
<button class="close" data-close="alert"></button>
<span>
Enter your email and password. </span>
</div>
<div class="form-group">
<!--ie8, ie9 does not support html5 placeholder, so we just show field title for that-->
{!! Form::label('email', 'Email ID', array('class' => 'control-label visible-ie8 visible-ie9')) !!}
{!! Form::text(['class'=>'form-control form-control-solid placeholder-no-fix','type'=>'email', 'autocomplete'=>'off', 'placeholder'=>'Email ID','name'=>'email']) !!}
</div>
.
.
.
.
{!! Form::close() !!}
我收到了以下错误:
请帮忙
答案 0 :(得分:1)
Form::text()
的论据是错误的。
而不是
Form::text(['class'=>'form-control form-control-solid placeholder-no-fix','type'=>'email', 'autocomplete'=>'off', 'placeholder'=>'Email ID','name'=>'email'])
你应该
Form::email('email', null, ['class'=>'form-control form-control-solid placeholder-no-fix', 'autocomplete'=>'off', 'placeholder'=>'Email ID'])
根据docs。