PHP code example of clue / confgen

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

    

clue / confgen example snippets


// $data = loadFromYaml('input.yml');
// $data = parseFromIni('input.ini');
$data = fetchFromDatabase();
file_put_contents('data.json', json_encode($data));

$factory = new Factory();

$twig = new Twig_Environment();
$twig->addFilter(new Twig_SimpleFilter('backwards', function ($value) {
    return strrev($value);
});

$factory = new Factory($twig);

$confgen = $factory->createConfgen();

$confgen->processTemplate('template.twig', 'data.json');

$confgen->processDefinition('confgen.json', 'data.json');