PHP code example of marella / phig

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

    

marella / phig example snippets




er = new \Phig\ConfigLoader();
$config = $loader->read(__DIR__.'/config');

$timezone = $config['app.timezone']; // 'UTC'
$locale = $config['app']['locale']; // 'en'
$database = $config['database']; // array
$host = $database['host']; // 'localhost'



return [
    'timezone' => 'UTC',
    'locale' => 'en',
];



return [
    'host' => 'localhost',
    'database' => 'forge',
    'username' => 'forge',
    'password' => '',
];