change.php
2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
use yii\bootstrap\ActiveForm;
use yii\helpers\{
Html, Url
};
//$this->title = Yii::t('user', 'Password change');
/**
* @var $model \frontend\modules\user\models\form\ChangePassword
*/
?>
<?php if (!empty($model->getFlash())) : ?>
<div class="row">
<div class="col-lg-5"><?= implode(',', ($model->getFlash())) ?></div>
</div>
<?php
$model->password_old = '';
$model->password = '';
$model->password_confirmation = '';
?>
<?php endif; ?>
<div class="row">
<div class="col-sm-6 col-sm-offset-3 profile_form">
<div class="row form-group">
<div class="col-sm-12 profile_form_title" style="text-align: center">
<?= Yii::t('user', 'Password change') ?>
</div>
</div>
<div class='form-password-change'>
<?php $form = ActiveForm::begin([
'action' => Url::toRoute(['/user/password/change']),
]); ?>
<div class="row form-group">
<div class="col-sm-8 col-sm-offset-2">
<?= $form->field($model, 'password_old')->passwordInput([
// 'placeholder' => $model->getAttributeLabel('password_old')
]) ?>
<?= $form->field($model, 'password')->passwordInput([
// 'placeholder' => $model->getAttributeLabel('password')
]) ?>
<?= $form->field($model, 'password_confirmation')->passwordInput([
// 'placeholder' => $model->getAttributeLabel('password_confirmation')
]) ?>
</div>
</div>
<div class="row form-group">
<div class="col-sm-8 col-sm-offset-2" style="text-align: center;">
<?= Html::submitButton(Yii::t('app', 'Save'), ['class' => 'btn btn-primary']) ?>
<?= Html::a(Yii::t('app', 'Cancel'), ['/user/profile/index'], ['class' => 'btn btn-cancel']) ?>
</div>
</div>
<?php
ActiveForm::end();
?>
</div>
</div>
</div>