PHP code example of mikelooper / container-settings

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

    

mikelooper / container-settings example snippets


// settings.php
return [
    'foo' => [
        'bar' => 1
    ]
];

// index.php
use ContainerFactory;

$settingsPath = __DIR__ . '/settings.php'; // or array
$container = ContainerFactory::create($settingsPath);

$settings = $container->get(SettingsInterface::class');
$number = $settings->get('foo.bar');
echo $number; // 1