Ejemplo n.º 1
0
 public function getDataProvider()
 {
     $query = self::find();
     $params = User::getConfig();
     if ($params['show_delete'] == 0) {
         $query->andWhere(['>', "status", User::STATUS_DELETED]);
     }
     return new ActiveDataProvider(['query' => $query]);
 }
Ejemplo n.º 2
0
 public function actionConfig()
 {
     if (Yii::$app->request->post('is_send')) {
         User::saveConfig(['show_delete' => Yii::$app->request->post('show_delete', 0)]);
         //            $this->refresh();
     }
     $params = User::getConfig();
     return $this->render('config', ['params' => $params]);
 }
Ejemplo n.º 3
0
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use developeruz\yii2_user\models\User;
$this->title = 'Просмотр пользователя';
$this->params['breadcrumbs'][] = ['label' => 'Управление пользователями', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="links-create">

    <h1><?php 
echo Html::encode($this->title) . ' ' . $model->username;
?>
</h1>

    <div class="links-form">

        <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['username', 'email:email', ['attribute' => 'status', 'value' => User::getStatusName($model->status)]]]);
?>

    </div>
    <?php 
$event = new \yii\base\ViewEvent();
Yii::$app->modules['user']->trigger(\developeruz\yii2_user\Yii2User::EVENT_RENDREN_IN_VIEW, $event);
?>

</div>