PHP code example of yiisoft / yii2-app-advanced

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

    

yiisoft / yii2-app-advanced example snippets


'db' => [
    'class' => \yii\db\Connection::class,
    'dsn' => 'mysql:host=mysql;dbname=yii2advanced',
    'username' => 'yii2advanced',
    'password' => 'secret',
    'charset' => 'utf8',
],

'db' => [
    'dsn' => 'mysql:host=mysql;dbname=yii2advanced_test',
],

return [
    'components' => [
        'db' => [
            'class' => \yii\db\Connection::class,
            'dsn' => 'mysql:host=localhost;dbname=yii2advanced',
            'username' => 'root',
            'password' => '1234',
            'charset' => 'utf8',
        ],
    ],
];

'db' => [
    'class' => \yii\db\Connection::class,
    'dsn' => 'mysql:host=mysql;dbname=yii2advanced',
    'username' => 'yii2advanced',
    'password' => 'secret',
    'charset' => 'utf8',
],
bash
php init --env=Development --overwrite=All
bash
docker compose exec frontend php /app/init --env=Development --overwrite=All
bash
php yii migrate
bash
docker compose exec frontend php /app/yii migrate