0
在我的刀片中,我有這個更改密碼功能,我希望它「顯示」舊密碼,當用戶有錯誤,例如用戶輸入什麼,並單擊提交,所以在這裏在我的刀片使用Form :: password laravel的舊輸入4.2
<div class="form-group">
{{ Form::label('cpass', 'Current Password') }} <span style="color:red"><i>{{ $errors->first('cpass', ':message') }}</i></span>
{{ Form::password('cpass', array('class' => 'form-control' , 'placeholder'=>'enter current password') , Input::old('cpass')) }}
</div>
<div class="form-group">
{{ Form::label('npass', 'New Password') }} <span style="color:red"><i>{{ $errors->first('npass', ':message') }}</i></span>
{{ Form::password('npass', array('class' => 'form-control', 'placeholder'=>'enter new password'), Input::old('npass')) }}
</div>
<div class="form-group">
{{ Form::label('rpass', 'Re-type new Password') }} <span style="color:red"><i>{{ $errors->first('rpass', ':message') }}</i></span>
{{ Form::password('rpass', array('class' => 'form-control', 'placeholder'=>'re-type new password'), Input::old('rpass')) }}
</div>
在我的控制器
代碼我把它像這樣
$validator = Validator::make(Input::all(), $rules, $messages);
if ($validator->fails())
{
return Redirect::to('User_Profile')
->withErrors($validator)
->withInput(Input::all());
}
else
{
//do stuff
}
我不知道爲什麼我不是獲得來自用戶的舊的輸入。什麼可能是錯誤的IM在做什麼?感謝
謝謝你的回答! :) – BourneShady
不是問題! :) –