PHP code example of adyoi / yii2-webapps

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

    

adyoi / yii2-webapps example snippets


 Default Directory Frontend /
 Default Directory Backend /backend

 # Change Directory Backend
 $ sudo ./chbackend.sh



return [
    'components' => [
    
        'application' => [
            'class' => 'common\components\Application',
        ],
        
        'db' => [
            'class' => 'yii\db\Connection',
            'dsn' => 'mysql:host=localhost;dbname=webapps',
            'username' => 'root',
            'password' => '',
            'charset' => 'utf8',
        ],
        
        'db2' => [
            'class' => 'yii\db\Connection',
            'dsn' => 'mysql:host=localhost;dbname=webapps_table',
            'username' => 'root',
            'password' => '',
            'charset' => 'utf8',
        ],
        
        ...
        ...
        
    ],
];


return [
    'bsVersion' => '4.x',
    'bsDependencyEnabled' => false,
    'upload' => '/images/upload/',
];


return [
    // Language
    'language' => 'id_ID',
    // Timezone
    'timeZone' => 'Asia/Jakarta',
    
    ...
    ...
    
];

RewriteEngine on
# link generate to http://localhost/webapps/backend
RewriteBase /webapps/backend

...
...


// User Access
username : root
password : root

// Demo Menu
username : menu
password : menu

// User 
username : admin
password : admin

username : user
password : user

Frontend : http://localhost/webapps/
Backend  : http://localhost/webapps/backend