setting.php 1.52 KB
<?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 ();
?>