- Issue created by @damien laguerre
- 🇫🇷France damien laguerre
damien laguerre → changed the visibility of the branch 10.3.x to hidden.
- @damien-laguerre opened merge request.
Allow another module to override the LeafletDefaultFormatter field formatter.
If you create a plugin that overrides the formatter, it's impossible to add services, as the class returned is not the one you expect.
Create a new FieldFormatter plugin that override LeafletDefaultFormatter.
Add:
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
$instance = parent::create($container, $configuration, $plugin_id, $plugin_definition);
$instance->foo= $container->get('foo');
return $instance;
}
Replace
return new self(...
by
return new static(...
Active
10.3
Code
damien laguerre → changed the visibility of the branch 10.3.x to hidden.