1. Go to this page and download the library: Download codemix/yii2-configloader 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/ */
codemix / yii2-configloader example snippets
use codemix\yii2confload\Config;
Config::initEnv('/path/to/app');
$setting = Config::env('MY_SETTING', 'default');
use codemix\yii2confload\Config;
$config = new Config('/path/to/app', false);
// Reads configuration from config/web.php
$webConfig = $config->web();
use codemix\yii2confload\Config;
$config = new Config('/path/to/app', false);
// Merges configuration from config/web.php and config/local.php if present
$webConfig = $config->web([], true);
// Merges configuration from config/console.php and config/local-console.php if present
$consoleConfig = $config->console([], true);
use codemix\yii2confload\Config;
$config = new Config('/path/to/app', false);
$webConfig = $config->web(['id' => 'test'], true);