Skip to content

Instantly share code, notes, and snippets.

@Caroga
Created July 28, 2015 09:02
Show Gist options
  • Save Caroga/117b0569dc197809e0a6 to your computer and use it in GitHub Desktop.
Save Caroga/117b0569dc197809e0a6 to your computer and use it in GitHub Desktop.
<?php
namespace CarogaNet\DirectWordpress\ApiBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
class ApiExtension extends Extension
{
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('parameters.yml');
// $container->setParameter('my.param_name', $value); ? This is weird, since I want the values to be autoloaded from my parameters.yml
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment