public function ContainerBuilder::register in Service Container 7.2
Same name in this branch
- 7.2 lib/Drupal/Core/DependencyInjection/ContainerBuilder.php \Drupal\Core\DependencyInjection\ContainerBuilder::register()
- 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/ContainerBuilder.php \Symfony\Component\DependencyInjection\ContainerBuilder::register()
Same name and namespace in other branches
- 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/ContainerBuilder.php \Symfony\Component\DependencyInjection\ContainerBuilder::register()
Registers a service definition.
This methods allows for simple registration of service definition with a fluid interface.
@api
Parameters
string $id The service identifier:
string $class The service class:
Return value
Definition A Definition instance
1 call to ContainerBuilder::register()
- ContainerBuilder::register in lib/
Drupal/ Core/ DependencyInjection/ ContainerBuilder.php - Registers a service definition.
1 method overrides ContainerBuilder::register()
- ContainerBuilder::register in lib/
Drupal/ Core/ DependencyInjection/ ContainerBuilder.php - Registers a service definition.
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ ContainerBuilder.php, line 769
Class
- ContainerBuilder
- ContainerBuilder is a DI container that provides an API to easily describe services.
Namespace
Symfony\Component\DependencyInjectionCode
public function register($id, $class = null) {
return $this
->setDefinition($id, new Definition($class));
}