thienhungho/yii2-user-management

Yii2 User Management

v1.2.1 2019-05-14 11:38 UTC

README

User Management System for Yii2

Installation

This is just an example, memorible moment. The source code may not work for known reasons. This source code include against loss license feature.

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist thienhungho/yii2-user-management "*"

or add

"thienhungho/yii2-user-management": "*"

to the require section of your composer.json file.

Migration

Run the following command in Terminal for database migration:

yii migrate/up --migrationPath=@vendor/thienhungho/UserManagement/migrations

Or use the namespaced migration (requires at least Yii 2.0.10):

// Add namespace to console config:
'controllerMap' => [
    'migrate' => [
        'class' => 'yii\console\controllers\MigrateController',
        'migrationNamespaces' => [
            'thienhungho\UserManagement\migrations\namespaced',
        ],
    ],
],

Then run:

yii migrate/up

Config

Add components user to your AppConfig file.

...
'components'          => [
    ...
    'user' => [
        'identityClass' => '\thienhungho\UserManagement\models\User',
    ],
    ...
],
...

Add module UserManage to your AppConfig file.

...
'modules'          => [
    ...
    'user-manage' => [
        'class' => '\thienhungho\UserManagement\modules\UserManage\UserManage',
    ],
    ...
],
...

Add module UserProfile to your AppConfig file.

...
'modules'          => [
    ...
    'user-profile' => [
        'class' => '\thienhungho\UserManagement\modules\UserProfile\UserProfile',
        'layout' => '@backend/views/layouts/main2',
    ],
    ...
],
...

Models

User

Modules

UserBase, UserManage, UserProfile, UserSetting

Functions

Core