Example #1
0
<?php

/**
 * @var yii\base\View $this View
 * @var vova07\users\models\backend\User $user User
 * @var vova07\users\models\Profile $profile Profile
 * @var array $roleArray Roles array
 * @var array $statusArray Statuses array
 */
use vova07\control\Widget;
$this->title = Yii::t('users', 'BACKEND_CREATE_TITLE');
echo Widget::widget(['title' => $this->title, 'url' => ['index'], 'items' => ['cancel' => ['visible' => true]]]);
echo $this->render('_form', ['user' => $user, 'profile' => $profile, 'roleArray' => $roleArray, 'statusArray' => $statusArray]);
Example #2
0
<?php

/**
 * @var yii\base\View $this View
 * @var dvizh\users\models\backend\User $user User
 * @var dvizh\users\models\Profile $profile Profile
 * @var array $roleArray Roles array
 * @var array $statusArray Statuses array
 */
use vova07\control\Widget;
$this->title = Yii::t('users', 'BACKEND_UPDATE_TITLE');
echo Widget::widget(['title' => $this->title, 'url' => ['update', 'id' => $user['id']], 'modelId' => $user['id'], 'items' => ['create' => ['visible' => true], 'cancel' => ['visible' => true]]]);
echo $this->render('_form', ['user' => $user, 'profile' => $profile, 'roleArray' => $roleArray, 'statusArray' => $statusArray]);
Example #3
0
<?php

/**
 * @var yii\base\View $this View
 * @var dvizh\users\models\backend\User $model User
 */
use vova07\control\Widget;
use yii\widgets\DetailView;
$this->title = Yii::t('users', 'BACKEND_VIEW_TITLE');
echo Widget::widget(['title' => $this->title, 'url' => ['view', 'id' => $model['id']], 'modelId' => $model['id'], 'items' => ['create' => ['visible' => true], 'update' => ['visible' => true], 'back' => ['visible' => true]]]);
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'username', 'email', ['attribute' => 'name', 'value' => $model->profile->name], ['attribute' => 'surname', 'value' => $model->profile->surname], 'status', 'created_at:date', 'updated_at:date']]);
Example #4
0
<?php

/**
 * @var yii\base\View $this View
 * @var yii\data\ActiveDataProvider $dataProvider Data provider
 * @var dvizh\users\models\backend\UserSearch $searchModel Search model
 * @var array $roleArray Roles array
 * @var array $statusArray Statuses array
 */
use vova07\control\Widget;
use yii\grid\ActionColumn;
use yii\grid\CheckboxColumn;
use yii\grid\GridView;
use yii\helpers\Html;
use yii\widgets\Pjax;
$this->title = Yii::t('users', 'BACKEND_INDEX_TITLE');
echo Widget::widget(['title' => $this->title, 'url' => ['index'], 'gridId' => 'users-grid', 'items' => ['create' => ['visible' => true]]]);
Pjax::begin();
echo GridView::widget(['id' => 'users-grid', 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => CheckboxColumn::classname()], 'id', ['attribute' => 'username', 'format' => 'raw', 'value' => function ($model) {
    return Html::a($model['username'], ['view', 'id' => $model['id']], ['data-pjax' => 0]);
}], ['attribute' => 'name', 'value' => function ($model) {
    return $model->profile['name'];
}], ['attribute' => 'surname', 'value' => function ($model) {
    return $model->profile['surname'];
}], 'email', ['attribute' => 'status_id', 'value' => function ($model) {
    return $model->status;
}, 'filter' => Html::activeDropDownList($searchModel, 'status_id', $statusArray, ['class' => 'form-control', 'prompt' => Yii::t('users', 'BACKEND_PROMPT_STATUS')])], ['attribute' => 'role', 'filter' => Html::activeDropDownList($searchModel, 'role', $roleArray, ['class' => 'form-control', 'prompt' => Yii::t('users', 'BACKEND_PROMPT_ROLE')])], ['class' => ActionColumn::className()]]]);
Pjax::end();