Yii2 advancedApp with Yii2 admin, user and few more
This is a yii2 advanced application template based app comes with pre-installed RBAC (mdmsoft/yii2-admin), User profile (dektrium/yii2-user), upload files plugin (mdmsoft/yii2-upload-file) and few more coming to boostup initial development time.
Before start installation procedure, make sure composer and git is installed properly. Check this: Composer and php environment variable fix
Yii2 AdvancedApp Installation
and then run
3. Create a Database named yii2_advance or as your preferred and update the db config.
4. To get rid of the access control issues with console application (e.g.
), in the file
your-app-path/yii comment out the line
require(__DIR__ . '/common/config/main.php'), in config marge function
$config = yii\helpers\ArrayHelper::merge
The $config var in application root
yii file will look like this:
$config = yii\helpers\ArrayHelper::merge( // require(__DIR__ . '/common/config/main.php'), // Commented to avoid yii-admin access controll issues require(__DIR__ . '/common/config/main-local.php'), require(__DIR__ . '/console/config/main.php'), require(__DIR__ . '/console/config/main-local.php') );
5. Run all DB migration simply by
yii migrate/up --migrationPath=@vendor/azraf/yii2-simpleapp/migrations/initials
After the migration task complete, we can revert the yii $config, that we have done in step 4. But have to keep in mind that, if further console command needed, we have to do the step 4 again.
You have all set! Now try it.
POST INSTALLATION TASK
1. You can change the mdm\yii2-admin web access path by setting any custom word instead of
admin in the line
$mdmAdminPath = 'admin'; of the config file:
2. Then browse to
http://[YOUR-APPLICATION-PATH]/index.php/admin/ in your browser. If you have changed the
$mdmAdminPath value in config, then change the URL accordingly.
3. Configure Yii2-admin as your need, set Permission/Roles and assign them to User
4. After configuration complete, comment out the line in your configuration file’s
'as access' part.
'as access' => [ 'class' => 'mdm\admin\components\AccessControl', 'allowActions' => [ // $mdmAdminPath.'/*'', // ::: IMPORTANT :::: Make it disable after configuring the USER Roles/Permissions
Now you all set!
Status and Related Resource Links
Status: DONE, works well with Yii2-admin
GitHub repo: https://github.com/dektrium/yii2-user
Status: DONE, works well with Yii2-user
GitHub repo: https://github.com/mdmsoft/yii2-admin
Status: DONE. This package contains some migration scripts that simplify the setup process and some extending core classes to add extra methods to controllers.
GitHub repo: https://github.com/azraf/yii2-simpleapp
Status: Not published yet, fixing some JS conflicts.
GitHub repo: https://github.com/almasaeed2010/AdminLTE