PHP code example of worstinme / yii2-user

1. Go to this page and download the library: Download worstinme/yii2-user library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

worstinme / yii2-user example snippets


'modules' => [
    'user' => [
        'class' => 'worstinme\user\Module',
    ],
    'useradmin' => [
        'class' => 'worstinme\user\backend\Module',
    ],
    ....
 ],
'components' => [
	'user' => [
        'class'=>'worstinme\user\User',
        'identityClass' => 'worstinme\user\models\User',
        'enableAutoLogin' => true,
        'loginUrl'=>['/user/default/login'],
    ],
    'authClientCollection' => [
        'class' => 'yii\authclient\Collection',
        'clients' => [
            'google' => [
                'class' => 'yii\authclient\clients\GoogleOpenId'
            ],
            'facebook' => [
                'class' => 'yii\authclient\clients\Facebook',
                'clientId' => 'facebook_client_id',
                'clientSecret' => 'facebook_client_secret',
            ],
            // etc.
        ],
    ]
    //	...
]

    'authManager' => [
            'class' => 'yii\rbac\DbManager',
    ],
]

php composer.phar