PHP code example of tasmaniski / laminas-config-helper

1. Go to this page and download the library: Download tasmaniski/laminas-config-helper 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/ */

    

tasmaniski / laminas-config-helper example snippets


'modules' => array(
    '...',
    'ConfigHelper'
),

//read specific key registred in your config file.
$keyFromConfig = $this->configHelp('key_from_config');

// or in new version of PHP
$keyFromConfig = $this->configHelp()->key_from_config;
$keyFromConfig = $this->configHelp()['key_from_config']; // only for 5.4+

// this will read whole config
$config = $this->configHelp(); // return config object Laminas\Config\Config
echo $config->key_from_config;