首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为for i2.0安装用户管理

为for i2.0安装用户管理
EN

Stack Overflow用户
提问于 2015-09-06 17:25:36
回答 1查看 500关注 0票数 1

我一直在尝试为Yii2.0安装user-management,但是在加载页面的时候得到了ReflectionException。我已经附上了下面的错误页面和目录结构。

文件路径如下所示。

我已经搜索了很多次,以找出原因,但没有找到任何结果。谁能告诉我我错过了什么才能让它工作。看起来user-management installation documentation有一些缺陷。它还不够清楚,无法理解。希望得到安装的步骤。谢谢

这是我的控制台/web.php

代码语言:javascript
复制
    <?php

$params = require(__DIR__ . '/params.php');

$config = [
'id' => 'basic',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'components' => [
    'request' => [
        // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
        'cookieValidationKey' => 'gAry7SfUr0oOjNQDqItsobmGBcJajQoW',
    ],
    'cache' => [
        'class' => 'yii\caching\FileCache',
    ],
    'user' => [
        //'identityClass' => 'app\models\User',
        'enableAutoLogin' => true,
        'class' => 'app\webvimark\modules\user-management\components\UserConfig',

    // Comment this if you don't want to record user logins
    'on afterLogin' => function($event) {
            \webvimark\modules\user-management\models\UserVisitLog::newVisitor($event->identity->id);
        }
    ],
    'errorHandler' => [
        'errorAction' => 'site/error',
    ],
    'mailer' => [
        'class' => 'yii\swiftmailer\Mailer',
        // send all mails to a file by default. You have to set
        // 'useFileTransport' to false and configure a transport
        // for the mailer to send real emails.
        'useFileTransport' => true,
    ],
    'log' => [
        'traceLevel' => YII_DEBUG ? 3 : 0,
        'targets' => [
            [
                'class' => 'yii\log\FileTarget',
                'levels' => ['error', 'warning'],
            ],
        ],
    ],
    'db' => require(__DIR__ . '/db.php'),
],

'modules'=>[
'user-management' => [
    'class' => 'webvimark\modules\user-management\UserManagementModule',

    // 'enableRegistration' => true,

    // Here you can set your handler to change layout for any controller or action
    // Tip: you can use this event in any module
    'on beforeAction'=>function(yii\base\ActionEvent $event) {
            if ( $event->action->uniqueId == 'user-management/auth/login' )
            {
                $event->action->controller->layout = 'loginLayout.php';
            };
        },
    ],
],
'params' => $params,
];

if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
    'class' => 'yii\debug\Module',
];

$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
    'class' => 'yii\gii\Module',
];
}

return $config;
EN

回答 1

Stack Overflow用户

发布于 2015-09-06 21:30:21

它似乎与此扩展的预期配置略有不同。

使用这个

代码语言:javascript
复制
'class' => 'webvimark\modules\UserManagement\components\UserConfig',

ie UserManagement而不是user-management是配置路径,而不是路由

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32421971

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档