PHP code example of darvinstudio / darvin-config-bundle

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

    

darvinstudio / darvin-config-bundle example snippets


// AppBundle\Config\AppConfig.php

use Darvin\ConfigBundle\Configuration\AbstractConfiguration;
use Darvin\ConfigBundle\Parameter\ParameterModel;

class AppConfig extends AbstractConfiguration
{
    public function getModel(): iterable
    {
        yield new ParameterModel('array_var', ParameterModel::TYPE_ARRAY, array(1, 2, 3));
        yield new ParameterModel('boolean_var', ParameterModel::TYPE_BOOL, false);
        yield new ParameterModel('integer_var', ParameterModel::TYPE_INTEGER, 777);
        yield new ParameterModel('string_var', ParameterModel::TYPE_STRING, 'test123');
    }
}