PHP code example of fsyd88 / yii2-admin

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

    

fsyd88 / yii2-admin example snippets


return [
    ...
    'aliases' => [
        '@fsyd/admin' => 'path/to/your/extracted',
        ...
    ]
];

php composer.phar 

'modules' => [
    "admin" => [
        "class" => "fsyd\admin\Module",
    ],
],
'as access' => [
    'class' => 'fsyd\admin\components\AccessControl',
    'allowActions' => [
        'site/*',
        'admin/*'
    ]
],
#rbac
"authManager" => [
    "class" => 'yii\rbac\DbManager', #这里记得用单引号而不是双引号        
    "defaultRoles" => ["guest"],
],


public function actionIndex()
{
    $this->layout='main-index';
    return $this->render('index');
}