PHP code example of andrylik / yii2-settings

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

    

andrylik / yii2-settings example snippets


'modules' => [
    'settings' => [
        'class' => 'andrylik\settings\Module',
    ],
],

return [
    // ...
    'languages' => ['uk', 'ru', 'en'], //languages to translate
    'defaultLanguage' => 'uk' //default app language
];

return [
    // ...
    'language' => 'uk',
    //..
];

'components' => [
    'cache' => [
        'class' => \yii\caching\FileCache::class,
        'cachePath' => '@frontend/runtime/cache'
    ],
    'settings' => [
        'class' => 'andrylik\settings\components\Settings',
    ],
],

$settings = Yii::$app->settings;

$value = $settings->get('section', 'key');
sh
php composer.phar 
sh
php yii migrate --migrationPath=@vendor/andrylik/yii2-settings/migrations
backend/config/main.php
common/config/params.php
common/config/main.php
common/config/main.php