PHP code example of dragooon / yaml-file-config

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

    

dragooon / yaml-file-config example snippets


$config = new \Dragooon\YamlFileConfig\YamlFileConfig('config.yml');
echo $config['timeout']; // 10
echo $config['parameter']['a']; // 1;
echo $config->get('name'); // abc

// You can also modify the configuration by either of the following
$config['timeout'] = 20;
$config->set('parameter', [
    'a' => 2,
    'b' => 3,
]);

// And finally save the file to write into config.yml
$config->save();