class FarmKmlServiceProvider in farmOS 2.x
Adds kml as known format.
Hierarchy
- class \Drupal\farm_kml\FarmKmlServiceProvider implements ServiceModifierInterface
Expanded class hierarchy of FarmKmlServiceProvider
File
- modules/
core/ kml/ src/ FarmKmlServiceProvider.php, line 11
Namespace
Drupal\farm_kmlView source
class FarmKmlServiceProvider implements ServiceModifierInterface {
/**
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container) {
if ($container
->has('http_middleware.negotiation') && is_a($container
->getDefinition('http_middleware.negotiation')
->getClass(), '\\Drupal\\Core\\StackMiddleware\\NegotiationMiddleware', TRUE)) {
$container
->getDefinition('http_middleware.negotiation')
->addMethodCall('registerFormat', [
'kml',
[
'application/vnd.google-earth.kml+xml',
],
]);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FarmKmlServiceProvider:: |
public | function |
Modifies existing service definitions. Overrides ServiceModifierInterface:: |