PHP code example of nick-jones / simpleconfig
1. Go to this page and download the library: Download nick-jones/simpleconfig 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/ */
nick-jones / simpleconfig example snippets
$container = new \SimpleConfig\Container(
[
'field1' => 'value',
// etc
],
[
'field2' => function() {
return new Foo();
}
]
);
echo $container['field1']; // prints "value"
$container->factory('foo', function() {
$class = $this['foo.class'];
return new $class();
});