shreenu / yii2-usermanagement
yii2 user management
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: ^2.0
This package is not auto-updated.
Last update: 2024-11-13 19:21:33 UTC
README
Yii2 User Management
Installation
The preferred way to install this extension is through composer.
Either run
composer require shreenu/yii2-usermanagement
or add
"shreenu/yii2-usermanagement": "*"
to the require section of your composer.json
file.
and run
composer update
Usage
change your configuration file.
'components' => [
'user'=> [
'identityClass' => \shreenu\usermanagement\models\User::className(),
'enableAutoLogin' => true,
],
]
'modules'=> [
'usermanagement'=>[
'class' => \shreenu\usermanagement\usermanagementModule::className(),
],
],
Login and Logout URLs:
Change your menu code
Yii::$app->user->isGuest ?
['label' => 'Login', 'url' => ['/usermanagement/user/login']] :
[
'label' => 'Logout (' . Yii::$app->user->identity->username . ')',
'url' => ['/usermanagement/user/logout'],
'linkOptions' => ['data-method' => 'post']
],