Пример #1
0
<?php

/* @var $this \yii\web\View */
/* @var $content string */
use yii\helpers\Html;
use yii\widgets\Pjax;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\bootstrap\ButtonDropdown;
use yii\widgets\Breadcrumbs;
use app\assets\AppAsset;
use app\modules\admin\models\BAdmins;
use app\modules\admin\models\BSettings;
$BAdmins = BAdmins::findOne(Yii::$app->user->id);
AppAsset::register($this);
$this->beginPage();
?>
<!DOCTYPE html>
<html lang="<?php 
echo Yii::$app->language;
?>
" style="background: none;">
<head>
    <meta charset="<?php 
echo Yii::$app->charset;
?>
">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?php 
echo Html::csrfMetaTags();
?>
Пример #2
0
 public function actionUserchange()
 {
     if (Yii::$app->user->isGuest) {
         $this->redirect(Yii::$app->user->loginUrl);
     }
     $model = BAdmins::findOne(Yii::$app->user->id);
     if (!$model) {
         $model = new BAdmins();
     }
     if ($model->load(Yii::$app->request->post())) {
         if ($model->validate()) {
             $model->password = md5(md5($model->password));
             $model->save();
             return $this->render('userchange', ['model' => $model, 'success' => true]);
         }
     }
     return $this->render('userchange', ['model' => $model]);
 }