class TwigExtensionsServiceProvider in Twig Extensions 8
Same name and namespace in other branches
- 8.2 src/TwigExtensionsServiceProvider.php \Drupal\twig_extensions\TwigExtensionsServiceProvider
Registers the twig services.
Hierarchy
- class \Drupal\Core\DependencyInjection\ServiceProviderBase implements ServiceModifierInterface, ServiceProviderInterface
- class \Drupal\twig_extensions\TwigExtensionsServiceProvider
Expanded class hierarchy of TwigExtensionsServiceProvider
File
- src/
TwigExtensionsServiceProvider.php, line 11
Namespace
Drupal\twig_extensionsView source
class TwigExtensionsServiceProvider extends ServiceProviderBase {
/**
* {@inheritdoc}
*/
public function register(ContainerBuilder $container) {
parent::register($container);
// Ensure the Intl PHP extension is available before adding the service.
if (class_exists('IntlDateFormatter')) {
$container
->register('twig_extensions.twig.intl', '\\Twig_Extensions_Extension_Intl')
->addTag('twig.extension');
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ServiceProviderBase:: |
public | function |
Modifies existing service definitions. Overrides ServiceModifierInterface:: |
5 |
TwigExtensionsServiceProvider:: |
public | function |
Registers services to the container. Overrides ServiceProviderBase:: |