You are here

public function ProjectExtension::load in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php \ProjectExtension::load()

Loads a specific configuration.

@api

Parameters

array $config An array of configuration values:

ContainerBuilder $container A ContainerBuilder instance:

Throws

\InvalidArgumentException When provided tag is not defined in this extension

Overrides ExtensionInterface::load

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php, line 9

Class

ProjectExtension

Code

public function load(array $configs, ContainerBuilder $configuration) {
  $config = call_user_func_array('array_merge', $configs);
  $configuration
    ->setDefinition('project.service.bar', new Definition('FooClass'));
  $configuration
    ->setParameter('project.parameter.bar', isset($config['foo']) ? $config['foo'] : 'foobar');
  $configuration
    ->setDefinition('project.service.foo', new Definition('FooClass'));
  $configuration
    ->setParameter('project.parameter.foo', isset($config['foo']) ? $config['foo'] : 'foobar');
  return $configuration;
}