如何在Laravel中将值传递给密码字段 [英] How to pass value to Password field in Laravel

查看:76
本文介绍了如何在Laravel中将值传递给密码字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取密码字段的值并以当前形式显示其中一个更新页面

{{ Form::label('Password')}} 

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

Laravel刀片服务器的密码字段语法不允许输入参数,例如对于文本字段一样,

Laravel blade's password field syntax does not allow parameter for input like it does for text fields for example,

{{ Form::label('Email or Username')}} 

{{ Form::text('email',$useremaildata,array('class' => 'form-control')) }} 

现在,我找到了一种使用占位符的解决方案,但这不是完成此操作的礼仪方式.共享以防万一.

Now I found one solution of using placeholders like that but it is not the rite way of doing it. Sharing just incase.

{{ Form::label('Password')}} 

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

任何帮助都会很棒.

推荐答案

简单的答案是您不这样做.密码字段应该很少预先填写,因此,由于Laravel不支持这种情况,因此并不常见.

The simple answer is that you don't do this. Password fields should rarely be pre-filled and so because it's not a common occurrence Laravel doesn't support it.

但是,如果您真的要这样做,则可以使用Form::input():

However, if you really want to do this you can use Form::input():

Form::input('password', 'name', 'value')

这篇关于如何在Laravel中将值传递给密码字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆