1. Go to this page and download the library: Download naffiq/yii2-bridge 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/ */
naffiq / yii2-bridge example snippets
return [
// ... your config
'modules' => [
'admin' => [
'class' => '\naffiq\bridge\BridgeModule',
// Add your projects modules here to keep right routing.
'modules' => [
'customModule' => ['class' => '\app\modules\your\CustomModule']
],
// Add menu item of your content management module to menu
'menu' => [
[
'title' => 'Content',
'url' => ['/admin/content/default/index'],
'active' => ['module' => 'content'],
'icon' => 'list'
]
],
// Alternatively you can define different menu items for different
// roles. In that case it will override default menu items, such as
// settings, users and dashboard
'composeMenu' => function ($user, $roles, $authManager) {
/**
* @var \yii\web\User $user
* @var \Da\User\Model\Role[] $roles
* @var \Da\User\Component\AuthDbManagerComponent $authManager
*/
if (isset($roles['admin'])) {
return
return [
// ... your config
'modules' => [
'admin' => ['class' => '\naffiq\bridge\BridgeModule']
],
'bootstrap' => [
'admin' // add module id to bootstrap for proper aliases and url routes binding
]
];
bash
$ php yii user/create EMAIL USERNAME PASSWORD ROLE