class BibciteBibtexServiceProvider in Bibliography & Citation 8
Same name and namespace in other branches
- 2.0.x modules/bibcite_bibtex/src/BibciteBibtexServiceProvider.php \Drupal\bibcite_bibtex\BibciteBibtexServiceProvider
Adds BibTeX as known format.
Hierarchy
- class \Drupal\bibcite_bibtex\BibciteBibtexServiceProvider implements ServiceModifierInterface
Expanded class hierarchy of BibciteBibtexServiceProvider
File
- modules/
bibcite_bibtex/ src/ BibciteBibtexServiceProvider.php, line 11
Namespace
Drupal\bibcite_bibtexView source
class BibciteBibtexServiceProvider implements ServiceModifierInterface {
/**
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container) {
if ($container
->has('http_middleware.negotiation')) {
$definition = $container
->getDefinition('http_middleware.negotiation');
if (is_a($definition
->getClass(), '\\Drupal\\Core\\StackMiddleware\\NegotiationMiddleware', TRUE)) {
$definition
->addMethodCall('registerFormat', [
'bibtex',
[
'text/plain',
'application/x-bibtex',
],
]);
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BibciteBibtexServiceProvider:: |
public | function |
Modifies existing service definitions. Overrides ServiceModifierInterface:: |