php - Installing Yii2 User Management Module -
i'm trying install user-management module yii2 application (for reference, that's module: https://github.com/webvimark/user-management).
let's have no idea composer installed , managed make work installation. i'm running local server application on shared-hosting don't have access ssh terminal.
i made changes specified in readme file , ran composer require --prefer-dist webvimark/module-user-management "*"
. did magic , saw, generated bunch of directories in vendor folder of application. uploaded them server when try load home page, error:
class webvimark\modules\usermanagement\components\userconfig not exist
the file here:
application_home\public_html\basic\vendor\webvimark\module-user-management\components
but seems application unable find it. have no modules directory (as used in previous versions of yii) , config , other files updated specified in readme file. ideas went wrong?
edit: in case, adding config/web.php:
<?php $params = require(__dir__ . '/params.php'); $config = [ 'id' => 'basic', 'basepath' => dirname(__dir__), 'bootstrap' => ['log'], 'components' => [ 'request' => [ // !!! insert secret key in following (if empty) - required cookie validation 'cookievalidationkey' => 'some_random_string', ], 'cache' => [ 'class' => 'yii\caching\filecache', ], /*'user' => [ 'identityclass' => 'app\models\user', 'enableautologin' => true, ],*/ 'user' => [ 'class' => 'webvimark\modules\usermanagement\components\userconfig', // comment if don't want record user logins 'on afterlogin' => function($event) { \webvimark\modules\usermanagement\models\uservisitlog::newvisitor($event->identity->id); } ], 'errorhandler' => [ 'erroraction' => 'site/error', ], 'mailer' => [ 'class' => 'yii\swiftmailer\mailer', // send mails file default. have set // 'usefiletransport' false , configure transport // mailer send real emails. 'usefiletransport' => true, ], 'log' => [ 'tracelevel' => yii_debug ? 3 : 0, 'targets' => [ [ 'class' => 'yii\log\filetarget', 'levels' => ['error', 'warning'], ], ], ], 'db' => require(__dir__ . '/db.php'), 'i18n' => [ 'translations' => [ 'frontend*' => [ 'class' => 'yii\i18n\phpmessagesource', 'basepath' => '@common/messages', ], 'backend*' => [ 'class' => 'yii\i18n\phpmessagesource', 'basepath' => '@common/messages', ], ], ], ], 'modules'=>[ 'user-management' => [ 'class' => 'webvimark\modules\usermanagement\usermanagementmodule', // here can set handler change layout controller or action // tip: can use event in 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 'dev' environment $config['bootstrap'][] = 'debug'; $config['modules']['debug'] = 'yii\debug\module'; $config['bootstrap'][] = 'gii'; $config['modules']['gii'] = 'yii\gii\module'; } return $config;
try using module , not component remove component , add in modules
'modules'=>[ 'user-management' => [ 'class' => 'webvimark\modules\usermanagement\usermanagementmodule',
Comments
Post a Comment