PHP code example of zabachok / yii2-burivuh

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

    

zabachok / yii2-burivuh example snippets


'modules' => [
    ...
    'burivuh' => [
        'class' => zabachok\burivuh\Module::class,
    ],
]

'bootstrap' => [..., zabachok\burivuh\Bootstrap::class],

'burivuh' => [
        'class' => zabachok\burivuh\Module::class,
        'db'=>'db',
    ...
    ],

'burivuh' => [
        'class' => zabachok\burivuh\Module::class,
        'usernameCallback'	=>function($user_id)
            {
                $user = \common\models\user\User::findIdentity($user_id);
                return is_null($user) ? 'Undefined' : $user->username;
            },
    ...
    ],

'burivuh' => [
        'class' => zabachok\burivuh\Module::class,
        'route' => 'wiki',
    ...
    ],

'burivuh' => [
        'class' => zabachok\burivuh\Module::class,
        'as access' => [
            'class' => yii\filters\AccessControl::className(),
            'rules' => [
                [
                    'allow' => true,
                    'roles' => ['?'],
                ],
            ],
        ],
    ...
    ],

php composer.phar 

php yii migrate --migrationPath=@vendor/zabachok/yii2-burivuh/migrations