PHP code example of dominus77 / yii2-basic-start

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

    

dominus77 / yii2-basic-start example snippets


$config = [
    //...
    'components' => [
        'db' => [
            'dsn' => 'mysql:host=localhost;dbname=yii2_basic_start',
            //...
        ],
        //...
    ],
    //...
];

$config = [
    //...
    'components' => [
        'db' => [
            'dsn' => 'mysql:host=localhost;dbname=yii2_basic_start_test',
            //...
        ],
        //...
    ],
    //...
];
bash
php init
bash
php yii users/user/create
bash
php yii

php yii rbac/roles/assign

php yii rbac/roles/revoke