1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Yiiのデバッグツールでユーザーを自由に切り替えるSwitchUser

Posted at

概要

Yii2のデバッグツールには、ユーザーを自由に切り替える機能があります。
開発中色々なユーザーで動作確認をしたいときに大変便利です。

前提条件

  • debugツールバーが使える
  • userの設定ができている

設定

common/config/main-local.php

'modules'=>[
    'debug' => [
        'class' => 'yii\debug\Module',
        'panels' => [
            'user' => [
                'class' => 'yii\debug\panels\UserPanel',
                'ruleUserSwitch' => [
                    'allow' => true,
                    'roles' => ['@'],
                ],
            ],
        ],
    ],
],

この設定でdebugツールのUserパネルにSwitchUserタブが表示されます。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?