Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 带引导的LARAVEL样式的密码字段_Html_Css_Twitter Bootstrap_Laravel_Laravel 4 - Fatal编程技术网

Html 带引导的LARAVEL样式的密码字段

Html 带引导的LARAVEL样式的密码字段,html,css,twitter-bootstrap,laravel,laravel-4,Html,Css,Twitter Bootstrap,Laravel,Laravel 4,在这个表单中,我拥有form::password(),我不能为此设置样式或嵌入类。例如,Form::text的以下类和样式可以正常工作 {{ Form::text('username', Input::old('username'), array('placeholder'=>'UserName', 'class'=>'form-control' ) ) }} 生成的HTML: <input id="username" class="form-control" type="t

在这个表单中,我拥有
form::password()
,我不能为此设置样式或嵌入类。例如,
Form::text
的以下类和样式可以正常工作

{{ Form::text('username', Input::old('username'), array('placeholder'=>'UserName', 'class'=>'form-control' ) ) }}
生成的HTML:

<input id="username" class="form-control" type="text" name="username" placeholder="username">
<input id="password" type="password" value="" name="password">
生成的HTML:

<input id="username" class="form-control" type="text" name="username" placeholder="username">
<input id="password" type="password" value="" name="password">

这将起作用:

{{ Form::password('password', array('placeholder'=>'Password', 'class'=>'form-control' ) ) }}

您不需要null,因为您无法为密码字段指定默认值

您还可以使用自定义HTML宏来启用与第一个示例类似的语法

请看我的回答:

谢谢,这对我很有帮助:)它对我很有用。谢谢{!!Form::password('password',array('placeholder'=>'staff.labels.password'),'required'=>'required','class'=>'Form-control','maxlength'=>'32'))!!}@if($errors->has('password')){{$errors->first('password')}@endif