Blame view

frontend/views/accounts/setting.php 1.52 KB
51e0a262   Yarik   test
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
  <?php
      /**
       * @var User $user
       */
      use common\models\Option;
      use common\models\User;
      use yii\helpers\Html;
      use yii\widgets\ActiveForm;
      use \common\widgets\MultiLangForm;
  
      $this->title = 'Настройки профиля';
      $this->params['breadcrumbs'][] = $this->title;
  ?>
  
  <h1><?= $this->title ?></h1>
  
  <?php
      if (\Yii::$app->session->hasFlash ('passwordupdate'))
      {
          ?>
          <div class="alert alert-warning alert-dismissible" role="alert">
              <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                  <span aria-hidden="true">&times;</span>
              </button>
              <p><?= \Yii::$app->session->getFlash ('passwordupdate') ?></p>
          </div>
          <?
      }
      $form = ActiveForm::begin ();
      echo "<p>Сменить пароль:</p>";
      echo $form->field ($user, 'old_password', ['template' => "{input}{label}\n{hint}\n{error}"])
                ->label ('Старый пароль')
                ->passwordInput (['value' => '']);
      echo $form->field ($user, 'new_password', ['template' => "{input}{label}\n{hint}\n{error}"])
                ->label ('Новый пароль')
                ->passwordInput (['value' => '']);
      echo $form->field ($user, 'password_reply', ['template' => "{input}{label}\n{hint}\n{error}"])
                ->label ('Повторите пароль')
                ->passwordInput (['value' => '']);
      echo Html::submitButton ('Обновить', ['class' => 'btn btn-primary']);
      $form->end ();
  ?>