PHP code example of itstructure / yii2-users-module

1. Go to this page and download the library: Download itstructure/yii2-users-module 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/ */

    

itstructure / yii2-users-module example snippets


use Itstructure\UsersModule\Module;
use Itstructure\UsersModule\controllers\ProfileController;

'modules' => [
    'users' => [
        'class' => Module::class,
        'controllerMap' => [
            'profile' => ProfileController::class,
        ],
    ],
],

use Itstructure\UsersModule\Module;
use Itstructure\UsersModule\components\ProfileValidateComponent;

'modules' => [
    'users' => [
        'class' => Module::class,
        'controllerMap' => [
            'profile' => ProfileController::class,
        ],
        'accessRoles' => ['admin', 'manager'],
        'components' => [
            'profile-validate-component' => [
                'class' => ProfileValidateComponent::class,
                'rules' => [...],
                'attributes' => [...],
                'attributeLabels' => [...],
                'formFields' => [...],
                'indexViewColumns' => [...],
                'detailViewAttributes' => [...],
            ],
        ]
    ],
],