PHP code example of freddokresna / yii2-admin-fkresna

1. Go to this page and download the library: Download freddokresna/yii2-admin-fkresna 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/ */

    

freddokresna / yii2-admin-fkresna example snippets


return [
    'modules' => [
        'admin' => [
            'class' => 'mdm\admin\Module',
            // Pilihan: left-menu, right-menu, top-menu, atau null.
            'layout' => 'left-menu',
        ],
    ],
    'components' => [
        'authManager' => [
            'class' => 'mdm\admin\components\DbManager',
        ],
    ],
];

'as access' => [
    'class' => 'mdm\admin\components\AccessControl',
    'allowActions' => [
        'site/login',
        'site/error',
    ],
],

'params' => [
    'mdm.admin.configs' => [
        'db' => 'db',
        'userDb' => 'db',
        'menuTable' => '{{%menu}}',
        'userTable' => '{{%user}}',
        'defaultUserStatus' => 10, // 0 = inactive, 10 = active
    ],
],

'as access' => [
    'class' => 'mdm\admin\components\AccessControl',
    'allowActions' => [
        'site/login',   // route publik — sesuaikan dengan aplikasi Anda
        'site/error',
    ],
],

'modules' => [
    'admin' => [
        'class' => 'mdm\admin\Module',
        'controllerMap' => [
            'assignment' => [
                'class' => 'mdm\admin\controllers\AssignmentController',
                'userClassName' => 'app\models\User',
                'idField' => 'id',
                'usernameField' => 'username',
                'fullnameField' => 'profile.full_name',
            ],
        ],
    ],
],
bash
php yii migrate --migrationPath=@yii/rbac/migrations
bash
php yii migrate --migrationPath=@mdm/admin/migrations