PHP code example of adrenalinkin / config-helper
1. Go to this page and download the library: Download adrenalinkin/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/ */
adrenalinkin / config-helper example snippets
namespace Acme\Bundle\ConfigBundle\DependencyInjection;
use Linkin\Component\ConfigHelper\Extension\AbstractExtension;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader;
class AcmeConfigExtension extends AbstractExtension
{
/**
* {@inheritdoc}
*/
public function getAlias()
{
return 'acme_config';
}
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
// load all configurations from the all registered bundles
$configs = $this->getConfigurationsFromFile('acme_config.yml', $container);
// process received configuration
$configs = $this->processConfiguration(new Configuration(), $configs);
// some actions
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
}
}