microinginer/yii2-debug-user-switch 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

microinginer/yii2-debug-user-switch

最新稳定版本:v1.0.0

Composer 安装命令:

composer require microinginer/yii2-debug-user-switch

包简介

User switcher

README 文档

README

This extension for yii2-debug. Use only development environment.

Install

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist microinginer/yii2-debug-user-switch:"dev-master"

or add

"microinginer/yii2-debug-user-switch":"dev-master"

to the require section of your composer.json file.

Configuration

// config/web.php

if (YII_ENV_DEV) {
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = [
        'class' => 'yii\debug\Module',
        ...
        'panels' => [
            'switchUser' => [
                'class' => 'microinginer\switchUser\SwitchPanel',
                'modelClass' => '\app\models\User',
                /*
                'queryCondition' => function (\yii\db\ActiveQuery &$query, \yii\db\ActiveRecord $model) {
                    $query->andWhere('suborg_id IS NOT NULL');
                },
                'gridViewColumns' => [
                    'full_name',
                    [
                        'attribute' => 'org.name',
                        'label' => 'Organization',
                    ],
                    [
                        'label' => Yii::t('app', 'Roles'),
                        'value' => function ($model) {
                            $roles = '';
                            foreach (Yii::$app->authManager->getRolesByUser($model->id) as $role) {
                                $roles .= ', ' . $role->name;
                            }
                            $roles = substr($roles, 1);
                            return $roles;
                        }
                    ],
                ],
                */
            ]
        ],
        ...
    ];
}

统计信息

  • 总下载量: 10.59k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-09-30