PHP code example of iampersistent / config-value-component

1. Go to this page and download the library: Download iampersistent/config-value-component 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/ */

    

iampersistent / config-value-component example snippets


  $config = (new GatherConfigValues)($container, 'print');
 
$printConfig = [
    'printer' => 'Epson TX-80',  
];

// print.config.php

return [
    'print' => [
        'printerType' => null,
    ]
];

$printConfig = [
    'print' => [
        'printer'     => 'Epson TX-80',  
        'printerType' => 'dot-matrix',
    ]
];

// print.config.php

return [
    'print' => [
        'printerType' => null,
        'speed'       => 'fast',
   ]
];

$printConfig = [
    'print' => [
        'printer'     => 'Epson TX-80',  
        'printerType' => 'dot-matrix',
        'speed'       => 'slow',
    ]
];

// print.config.php

return [
    'print' => [
        'location'    => 'Room 1',
        'printerType' => null,
        'speed'       => 'fast',
    ]
];

$printConfig = [
    'print' => [
        'location'    => 'Room 1',
        'printer'     => 'Epson TX-80',  
        'printerType' => 'dot-matrix',
        'speed'       => 'slow',
    ]
];

PRINT_PRINTER=Epson TX-80