PHP code example of wilkques / config

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

    

wilkques / config example snippets


    

    return [
        'abc' => 'efg',
    ];
    

      config()
    //->setPath('<config/path>') custom config path
    ->boot();

    $config = config('<key>'); // get config item

    $config->setItem('<key>', '<value>'); // set config item

    $config->withConfig([
        '<key>' => '<value>' // set config with array
    ]);

    $config->getItem('<key>'); // get config item

    $config->all(); // get config all items

    $config->foo = 'bar'; // set config item (magic property access)

    $config->foo; // get config item (magic property access), same as $config->getItem('foo')
    

$config->getItem('database.mysql.host'); // reaches into config/database/mysql.php's 'host' key
$config->setItem('database.mysql.host', '127.0.0.1');