PHP code example of coco-soft / config

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

    

coco-soft / config example snippets




//co\config\Config;

//set config file path
Config::setConfigDir('/path/to/config/dir');

//if get charset in app.php return 
$charset = Config::get('app.charset');

//or use a helper function
$charset = config('app.charset');

// the second parameter is if throw a exception
// when this config is not defined

$charset = config('app.charset', true);