PHP code example of ofcold / component-config

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

    

ofcold / component-config example snippets



$config = new Ofcold\Component\Config\Repository

// Set initial configuration items
$config->addNamespace('your-config-path');

// Add a namespace to configuration.
$config->addNamespace(__DIR__ '/your-path/config', 'user');

// Get a config item.
$config->get('foo');

// Get a namespace config item.
$config->get('user::foo.bar');